mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { useDocsSearch } from "fumadocs-core/search/client";
|
|
import { staticClient } from "fumadocs-core/search/client/orama-static";
|
|
import {
|
|
SearchDialog,
|
|
SearchDialogClose,
|
|
SearchDialogContent,
|
|
SearchDialogHeader,
|
|
SearchDialogIcon,
|
|
SearchDialogInput,
|
|
SearchDialogList,
|
|
SearchDialogOverlay,
|
|
type SharedProps,
|
|
} from "fumadocs-ui/components/dialog/search";
|
|
import { useI18n } from "fumadocs-ui/contexts/i18n";
|
|
|
|
export default function DefaultSearchDialog(props: SharedProps) {
|
|
const { locale } = useI18n();
|
|
const { search, setSearch, query } = useDocsSearch({
|
|
client: staticClient({
|
|
locale,
|
|
}),
|
|
});
|
|
|
|
return (
|
|
<SearchDialog search={search} onSearchChange={setSearch} isLoading={query.isLoading} {...props}>
|
|
<SearchDialogOverlay />
|
|
<SearchDialogContent>
|
|
<SearchDialogHeader>
|
|
<SearchDialogIcon />
|
|
<SearchDialogInput />
|
|
<SearchDialogClose />
|
|
</SearchDialogHeader>
|
|
<SearchDialogList items={query.data !== "empty" ? query.data : null} />
|
|
</SearchDialogContent>
|
|
</SearchDialog>
|
|
);
|
|
}
|