import { t } from "@lingui/macro"; import { FadersHorizontal, ReadCvLogo } from "@phosphor-icons/react"; import { Button, KeyboardShortcut, Separator } from "@reactive-resume/ui"; import { cn } from "@reactive-resume/utils"; import { motion } from "framer-motion"; import { Link, useLocation, useNavigate } from "react-router"; import useKeyboardShortcut from "use-keyboard-shortcut"; import { Copyright } from "@/client/components/copyright"; import { Icon } from "@/client/components/icon"; import { UserAvatar } from "@/client/components/user-avatar"; import { UserOptions } from "@/client/components/user-options"; import { useUser } from "@/client/services/user"; type Props = { className?: string; }; const ActiveIndicator = ({ className }: Props) => ( ); type SidebarItem = { path: string; name: string; shortcut?: string; icon: React.ReactNode; }; type SidebarItemProps = SidebarItem & { onClick?: () => void; }; const SidebarItem = ({ path, name, shortcut, icon, onClick }: SidebarItemProps) => { const isActive = useLocation().pathname === path; return ( ); }; type SidebarProps = { setOpen?: (open: boolean) => void; }; export const Sidebar = ({ setOpen }: SidebarProps) => { const { user } = useUser(); const navigate = useNavigate(); useKeyboardShortcut(["shift", "r"], () => { void navigate("/dashboard/resumes"); setOpen?.(false); }); useKeyboardShortcut(["shift", "s"], () => { void navigate("/dashboard/settings"); setOpen?.(false); }); const sidebarItems: SidebarItem[] = [ { path: "/dashboard/resumes", name: t`Resumes`, shortcut: "⇧R", icon: , }, { path: "/dashboard/settings", name: t`Settings`, shortcut: "⇧S", icon: , }, ]; return (
{sidebarItems.map((item) => ( setOpen?.(false)} /> ))}
); };