base-picker.tsx — ui Source File
Architecture documentation for base-picker.tsx, a tsx file in the ui codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR d22e0735_8a61_2573_f093_c81b998a1bba["base-picker.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] d22e0735_8a61_2573_f093_c81b998a1bba --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 f14cf7ca_f213_afc2_bc66_ebc0fb7d9834["config"] d22e0735_8a61_2573_f093_c81b998a1bba --> f14cf7ca_f213_afc2_bc66_ebc0fb7d9834 c97cebd0_0d39_fa69_4337_d0c1787c0b11["picker"] d22e0735_8a61_2573_f093_c81b998a1bba --> c97cebd0_0d39_fa69_4337_d0c1787c0b11 c27c6e95_5daf_4dd4_dc3a_add496837570["search-params"] d22e0735_8a61_2573_f093_c81b998a1bba --> c27c6e95_5daf_4dd4_dc3a_add496837570 style d22e0735_8a61_2573_f093_c81b998a1bba fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { BASES } from "@/registry/config"
import {
Picker,
PickerContent,
PickerGroup,
PickerRadioGroup,
PickerRadioItem,
PickerTrigger,
} from "@/app/(create)/components/picker"
import { useDesignSystemSearchParams } from "@/app/(create)/lib/search-params"
export function BasePicker({
isMobile,
anchorRef,
}: {
isMobile: boolean
anchorRef: React.RefObject<HTMLDivElement | null>
}) {
const [params, setParams] = useDesignSystemSearchParams()
const currentBase = React.useMemo(
() => BASES.find((base) => base.name === params.base),
[params.base]
)
const handleValueChange = React.useCallback(
(value: string) => {
const newBase = BASES.find((base) => base.name === value)
if (!newBase) {
return
}
setParams({ base: newBase.name })
},
[setParams]
)
return (
<Picker>
<PickerTrigger>
<div className="flex flex-col justify-start text-left">
<div className="text-muted-foreground text-xs">Component Library</div>
<div className="text-foreground text-sm font-medium">
{currentBase?.title}
</div>
</div>
{currentBase?.meta?.logo && (
<div
className="text-foreground *:[svg]:text-foreground! pointer-events-none absolute top-1/2 right-4 size-4 -translate-y-1/2 select-none *:[svg]:size-4"
dangerouslySetInnerHTML={{
__html: currentBase.meta.logo,
}}
/>
)}
</PickerTrigger>
<PickerContent
anchor={isMobile ? anchorRef : undefined}
side={isMobile ? "top" : "right"}
align={isMobile ? "center" : "start"}
>
<PickerRadioGroup
value={currentBase?.name}
onValueChange={handleValueChange}
>
<PickerGroup>
{BASES.map((base) => (
<PickerRadioItem key={base.name} value={base.name}>
{base.meta?.logo && (
<div
className="text-foreground *:[svg]:text-foreground! size-4 shrink-0 [&_svg]:size-4"
dangerouslySetInnerHTML={{
__html: base.meta.logo,
}}
/>
)}
{base.title}
</PickerRadioItem>
))}
</PickerGroup>
</PickerRadioGroup>
</PickerContent>
</Picker>
)
}
Domain
Subdomains
Functions
Dependencies
- config
- picker
- react
- search-params
Source
Frequently Asked Questions
What does base-picker.tsx do?
base-picker.tsx is a source file in the ui codebase, written in tsx. It belongs to the DesignEngine domain, PreviewSystem subdomain.
What functions are defined in base-picker.tsx?
base-picker.tsx defines 1 function(s): BasePicker.
What does base-picker.tsx depend on?
base-picker.tsx imports 4 module(s): config, picker, react, search-params.
Where is base-picker.tsx in the architecture?
base-picker.tsx is located at apps/v4/app/(create)/components/base-picker.tsx (domain: DesignEngine, subdomain: PreviewSystem, directory: apps/v4/app/(create)/components).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free