"use client"; import { Search } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; import { useMounted } from "@/hooks/use-mounted"; import { useTranslations } from "@/lib/i18n/context"; import { isApplePlatform } from "@/lib/keyboard/global-shortcuts"; import { openCommandPalette, preloadCommandPalette } from "./palette-store"; /** * The way into the command palette, at the trailing end of the top bar on * every signed-in page: a magnifier at every width, named "Search", with a * tooltip that gives the key that opens it as well ("Search (⌘K)", or * "Search (Ctrl K)" off Apple platforms). 44 px under a coarse pointer, 36 px * beside a fine one. Docked panels' strips stand right of the top bar, so the * magnifier always sits just left of them and nothing covers it. */ export function CommandPaletteTrigger() { const { t } = useTranslations(); // The key hint depends on the platform, which the server cannot know. const mounted = useMounted(); const apple = mounted && isApplePlatform(); const label = t("palette.title"); const keyHint = apple ? "⌘K" : "Ctrl K"; const shortcut = apple ? "Meta+K" : "Control+K"; return (