import { cn } from "@/util/utils"; import { NavLink, useSearchParams } from "react-router-dom"; type Option = { label: string; to: string; icon?: React.ReactNode; }; type Props = { options: Option[]; }; function SwitchBarNavigation({ options }: Props) { const [searchParams] = useSearchParams(); return (
{options.map((option) => { return ( { return cn( "flex cursor-pointer items-center justify-center rounded-sm px-3 py-2 text-center hover:bg-slate-700", { "bg-slate-700": isActive, }, ); }} > {option.icon && ( {option.icon} )} {option.label} ); })}
); } export { SwitchBarNavigation, type Option as SwitchBarNavigationOption };