2023-10-19 13:37:20 -04:00
|
|
|
"use client";
|
2023-10-13 19:02:59 -04:00
|
|
|
|
2023-10-19 13:37:20 -04:00
|
|
|
import { Input } from "@/components/ui/input";
|
|
|
|
import { commandDialogAtom } from "./CommandDialog";
|
|
|
|
import { useAtom } from "jotai";
|
2023-10-20 18:26:53 -04:00
|
|
|
import { Button } from "@/components/ui/button";
|
2023-10-19 13:37:20 -04:00
|
|
|
export default function Search() {
|
|
|
|
const [open, setOpen] = useAtom(commandDialogAtom);
|
2023-10-13 19:02:59 -04:00
|
|
|
return (
|
|
|
|
<div>
|
2023-10-20 18:26:53 -04:00
|
|
|
{/* <Input
|
2023-10-13 19:02:59 -04:00
|
|
|
type="search"
|
|
|
|
placeholder="Search..."
|
|
|
|
className="sm:w-[200px] lg:w-[300px]"
|
2023-10-19 13:37:20 -04:00
|
|
|
onFocus={() => setOpen(true)}
|
2023-10-20 18:26:53 -04:00
|
|
|
/> */}
|
|
|
|
<Button
|
|
|
|
onClick={() => setOpen(true)}
|
|
|
|
variant={"outline"}
|
|
|
|
className="items-center justify-start rounded-sm text-muted-foreground sm:pr-12 md:w-40 lg:w-64"
|
|
|
|
>
|
|
|
|
<span className="hidden lg:inline-flex">Search...</span>
|
|
|
|
<span className="inline-flex lg:hidden">Search...</span>
|
|
|
|
<kbd className="pointer-events-none absolute right-1.5 top-1.5 hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex">
|
|
|
|
<span className="text-xs">⌘</span>K
|
|
|
|
</kbd>
|
|
|
|
</Button>
|
2023-10-13 19:02:59 -04:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|