mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-27 21:33:41 +02:00
28 lines
812 B
TypeScript
28 lines
812 B
TypeScript
"use client";
|
|
|
|
import { Search } from "lucide-react";
|
|
import { SidebarMenuButton } from "@multica/ui/components/ui/sidebar";
|
|
import {
|
|
useShortcut,
|
|
} from "@multica/core/shortcuts";
|
|
import { useSearchStore } from "./search-store";
|
|
import { useT } from "../i18n";
|
|
import { ShortcutKeycaps } from "../common/shortcut-keycaps";
|
|
|
|
export function SearchTrigger() {
|
|
const { t } = useT("search");
|
|
const shortcut = useShortcut("openSearch");
|
|
return (
|
|
<SidebarMenuButton
|
|
className="text-muted-foreground"
|
|
onClick={() => useSearchStore.getState().setOpen(true)}
|
|
>
|
|
<Search />
|
|
<span>{t(($) => $.trigger.label)}</span>
|
|
{shortcut ? (
|
|
<ShortcutKeycaps shortcut={shortcut} decorative className="pointer-events-none ml-auto" />
|
|
) : null}
|
|
</SidebarMenuButton>
|
|
);
|
|
}
|