"use client" import * as React from "react" import { BASES } from "@/registry/config" import { Picker, PickerContent, PickerGroup, PickerRadioGroup, PickerRadioItem, PickerTrigger, } from "@/app/(app)/(create)/components/picker" import { useDesignSystemSearchParams } from "@/app/(app)/(create)/lib/search-params" export function BasePicker({ isMobile, anchorRef, }: { isMobile: boolean anchorRef: React.RefObject }) { 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 (
Base
{currentBase?.title}
{currentBase?.meta?.logo && (
)} {BASES.map((base) => ( {base.title} ))}
) }