mirror of https://github.com/buster-so/buster.git
Update SidebarItem.tsx
This commit is contained in:
parent
c0159efebd
commit
d20d6bf333
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue