()
| 460 | } |
| 461 | |
| 462 | export function Search() { |
| 463 | let [modifierKey, setModifierKey] = useState<string>(); |
| 464 | let { buttonProps, dialogProps } = useSearchProps(); |
| 465 | |
| 466 | useEffect(() => { |
| 467 | setModifierKey( |
| 468 | /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) ? '⌘' : 'Ctrl ' |
| 469 | ); |
| 470 | }, []); |
| 471 | |
| 472 | return ( |
| 473 | <div className="hidden lg:max-w-md lg:flex-auto xl:block"> |
| 474 | <button |
| 475 | type="button" |
| 476 | className="hidden h-10 w-full items-center gap-2 rounded-lg bg-background pl-2 pr-3 text-sm text-zinc-500 ring-1 ring-border transition hover:ring-border/20 ui-not-focus-visible:outline-none lg:flex dark:bg-white/5 dark:text-zinc-400 dark:shadow-inner dark:ring-inset dark:ring-border/10 dark:ring-white/10 dark:hover:ring-white/20" |
| 477 | {...buttonProps} |
| 478 | > |
| 479 | <SearchIcon className="h-5 w-5 flex-shrink-0 stroke-current" /> |
| 480 | <span className="flex-start truncate">Find something...</span> |
| 481 | <kbd className="ml-auto flex-shrink-0 text-2xs text-muted-foreground"> |
| 482 | <kbd className="font-sans">{modifierKey}</kbd> |
| 483 | <kbd className="font-sans">K</kbd> |
| 484 | </kbd> |
| 485 | </button> |
| 486 | <Suspense fallback={null}> |
| 487 | <SearchDialog className="hidden lg:block" {...dialogProps} /> |
| 488 | </Suspense> |
| 489 | </div> |
| 490 | ); |
| 491 | } |
| 492 | |
| 493 | export function MobileSearch() { |
| 494 | let { buttonProps, dialogProps } = useSearchProps(); |
nothing calls this directly
no test coverage detected