Update SidebarItem.tsx

This commit is contained in:
Nate Kelley 2025-03-13 13:26:33 -06:00
parent c0159efebd
commit d20d6bf333
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 8 additions and 2 deletions

View File

@ -58,7 +58,12 @@ const itemVariants = cva(
} }
); );
export const SidebarItem: React.FC<ISidebarItem & VariantProps<typeof itemVariants>> = React.memo( export const SidebarItem: React.FC<
ISidebarItem &
VariantProps<typeof itemVariants> & {
className?: string;
}
> = React.memo(
({ ({
label, label,
icon, icon,
@ -68,6 +73,7 @@ export const SidebarItem: React.FC<ISidebarItem & VariantProps<typeof itemVarian
active = false, active = false,
variant = 'default', variant = 'default',
onRemove, onRemove,
className = '',
onClick onClick
}) => { }) => {
const ItemNode = disabled || !route ? 'div' : Link; const ItemNode = disabled || !route ? 'div' : Link;
@ -75,7 +81,7 @@ export const SidebarItem: React.FC<ISidebarItem & VariantProps<typeof itemVarian
return ( return (
<ItemNode <ItemNode
href={route || ''} href={route || ''}
className={cn(itemVariants({ active, disabled, variant }))} className={cn(itemVariants({ active, disabled, variant }), className)}
onClick={onClick}> onClick={onClick}>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<span <span