You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
681 B
30 lines
681 B
import { Button } from "@components/UI/Button.tsx";
|
|
import type { LucideIcon } from "lucide-react";
|
|
import type { JSX } from "react";
|
|
|
|
export interface SidebarButtonProps {
|
|
label: string;
|
|
active?: boolean;
|
|
Icon?: LucideIcon;
|
|
element?: JSX.Element;
|
|
onClick?: () => void;
|
|
}
|
|
|
|
export const SidebarButton = ({
|
|
label,
|
|
active,
|
|
Icon,
|
|
element,
|
|
onClick,
|
|
}: SidebarButtonProps): JSX.Element => (
|
|
<Button
|
|
onClick={onClick}
|
|
variant={active ? "subtle" : "ghost"}
|
|
size="sm"
|
|
className="flex gap-2 w-full"
|
|
>
|
|
{Icon && <Icon size={16} />}
|
|
{element && element}
|
|
<span className="flex flex-1 justify-start flex-shrink-0">{label}</span>
|
|
</Button>
|
|
);
|
|
|