2023-06-09 18:21:18 +10:00
|
|
|
'use client';
|
|
|
|
|
|
2023-11-09 14:38:26 +11:00
|
|
|
import { HTMLAttributes, useState } from 'react';
|
|
|
|
|
|
|
|
|
|
import { Search } from 'lucide-react';
|
2023-06-09 18:21:18 +10:00
|
|
|
|
|
|
|
|
import { cn } from '@documenso/ui/lib/utils';
|
2023-11-09 14:38:26 +11:00
|
|
|
import { Button } from '@documenso/ui/primitives/button';
|
|
|
|
|
|
|
|
|
|
import { CommandMenu } from '../common/command-menu';
|
2023-06-09 18:21:18 +10:00
|
|
|
|
|
|
|
|
export type DesktopNavProps = HTMLAttributes<HTMLDivElement>;
|
|
|
|
|
|
|
|
|
|
export const DesktopNav = ({ className, ...props }: DesktopNavProps) => {
|
2023-08-29 17:26:19 +10:00
|
|
|
// const pathname = usePathname();
|
2023-11-09 14:38:26 +11:00
|
|
|
const [open, setOpen] = useState(false);
|
2023-08-07 23:10:27 +10:00
|
|
|
|
2023-06-09 18:21:18 +10:00
|
|
|
return (
|
2023-11-09 14:38:26 +11:00
|
|
|
<div
|
|
|
|
|
className={cn('ml-8 hidden flex-1 gap-x-6 md:flex md:justify-center', className)}
|
|
|
|
|
{...props}
|
|
|
|
|
>
|
|
|
|
|
<CommandMenu open={open} onOpenChange={setOpen} />
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
|
|
|
|
className="text-muted-foreground flex w-96 items-center justify-between rounded-lg"
|
|
|
|
|
onClick={() => setOpen((open) => !open)}
|
|
|
|
|
>
|
|
|
|
|
<div className="flex items-center">
|
|
|
|
|
<Search className="mr-2 h-5 w-5" />
|
|
|
|
|
Search
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<div className="text-muted-foreground bg-muted rounded-md px-1.5 py-0.5 font-mono text-xs">
|
|
|
|
|
Ctrl+K
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Button>
|
|
|
|
|
|
2023-08-29 17:26:19 +10:00
|
|
|
{/* We have no other subpaths rn */}
|
|
|
|
|
{/* <Link
|
2023-06-09 18:21:18 +10:00
|
|
|
href="/documents"
|
2023-06-11 01:50:19 -04:00
|
|
|
className={cn(
|
2023-08-28 00:56:15 +05:30
|
|
|
'text-muted-foreground focus-visible:ring-ring ring-offset-background rounded-md font-medium leading-5 hover:opacity-80 focus-visible:outline-none focus-visible:ring-2',
|
2023-06-11 01:50:19 -04:00
|
|
|
{
|
|
|
|
|
'text-foreground': pathname?.startsWith('/documents'),
|
|
|
|
|
},
|
|
|
|
|
)}
|
2023-06-09 18:21:18 +10:00
|
|
|
>
|
|
|
|
|
Documents
|
2023-08-29 17:26:19 +10:00
|
|
|
</Link> */}
|
2023-06-09 18:21:18 +10:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|