https://dev.kronoz.win/r/marzneshin.git
1
2import { Button } from '@marzneshin/components';
3import { PanelRightClose, PanelRightOpen } from 'lucide-react';
4import { FC } from 'react';
5
6interface ToggleButtonProps {
7 collapsed: boolean;
8 onToggle: () => void;
9}
10
11export const ToggleButton: FC<ToggleButtonProps> = ({ collapsed, onToggle }) => {
12 const Icon = (collapsed ? PanelRightClose : PanelRightOpen);
13
14 return (
15 <Button className="p-2 bg-secondary-foreground border-2 text-primary-foreground dark:bg-secondary dark:text-primary" onClick={onToggle}>
16 <Icon className="w-full h-full" />
17 </Button>
18 );
19};