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