import { ChevronDownIcon } from '@primer/octicons-react'; import type { Dispatch, ReactNode, SetStateAction } from 'react'; import { Button, ListBox, ListBoxItem, Popover, Select as AriaSelect, SelectValue, } from 'react-aria-components'; import { cn } from '~/utils/cn'; type SelectProps = Parameters[0] & { readonly label: string; readonly state?: [string, Dispatch>]; readonly children: ReactNode; }; function Select(props: SelectProps) { return ( { props.state?.[1](key.toString()); }} className={cn( 'block w-full rounded-lg my-1', 'border border-ui-200 dark:border-ui-600', 'bg-white dark:bg-ui-800 dark:text-ui-300', 'focus-within:outline-6', props.className, )} > {props.children} ); } type ItemProps = Parameters[0]; function Item(props: ItemProps) { return ( {props.children} ); } export default Object.assign(Select, { Item });