Function
SelectOption
({
id,
label,
as = 'li',
children,
})
Source from the content-addressed store, hash-verified
| 11 | }; |
| 12 | |
| 13 | export const SelectOption: FC<SelectOptionProps> = ({ |
| 14 | id, |
| 15 | label, |
| 16 | as = 'li', |
| 17 | children, |
| 18 | }) => { |
| 19 | return ( |
| 20 | <ListboxOption value={id} as={as}> |
| 21 | {({ active, selected }) => ( |
| 22 | <div |
| 23 | className={cn( |
| 24 | 'text-foreground cursor-pointer px-1 py-1', |
| 25 | active && 'outline-border outline-2', |
| 26 | )} |
| 27 | onMouseDown={(e) => e.preventDefault()} |
| 28 | > |
| 29 | <span className="relative inline-flex w-full flex-row items-center justify-between"> |
| 30 | {children ?? label} |
| 31 | {selected && <span className="flex items-center">✓</span>} |
| 32 | </span> |
| 33 | </div> |
| 34 | )} |
| 35 | </ListboxOption> |
| 36 | ); |
| 37 | }; |
Callers
nothing calls this directly
Tested by
no test coverage detected