'use client'; import type { HTMLAttributes } from 'react'; import { useEffect, useState } from 'react'; import Link from 'next/link'; import { useParams, usePathname } from 'next/navigation'; import { Search } from 'lucide-react'; import { getRootHref } from '@documenso/lib/utils/params'; import { cn } from '@documenso/ui/lib/utils'; import { Button } from '@documenso/ui/primitives/button'; import { CommandMenu } from '../common/command-menu'; const navigationLinks = [ { href: '/documents', label: 'Documents', }, { href: '/templates', label: 'Templates', }, ]; export type DesktopNavProps = HTMLAttributes; export const DesktopNav = ({ className, ...props }: DesktopNavProps) => { const pathname = usePathname(); const params = useParams(); const [open, setOpen] = useState(false); const [modifierKey, setModifierKey] = useState(() => 'Ctrl'); const rootHref = getRootHref(params, { returnEmptyRootString: true }); useEffect(() => { const userAgent = typeof navigator !== 'undefined' ? navigator.userAgent : 'unknown'; const isMacOS = /Macintosh|Mac\s+OS\s+X/i.test(userAgent); setModifierKey(isMacOS ? '⌘' : 'Ctrl'); }, []); return ( ); };