2024-10-24 16:35:51 -04:00
|
|
|
import { ComponentProps } from 'react';
|
|
|
|
|
|
2024-10-31 15:39:07 +05:30
|
|
|
import { SidebarTrigger, useSidebar } from '@/components/ui/sidebar';
|
2024-10-24 16:35:51 -04:00
|
|
|
import { BetterTooltip } from '@/components/ui/tooltip';
|
|
|
|
|
import { cn } from '@/lib/utils';
|
|
|
|
|
|
2024-10-31 15:39:07 +05:30
|
|
|
import { SidebarLeftIcon } from './icons';
|
|
|
|
|
import { Button } from '../ui/button';
|
|
|
|
|
|
2024-10-24 16:35:51 -04:00
|
|
|
export function SidebarToggle({
|
|
|
|
|
className,
|
|
|
|
|
}: ComponentProps<typeof SidebarTrigger>) {
|
2024-10-31 15:39:07 +05:30
|
|
|
const { toggleSidebar } = useSidebar();
|
|
|
|
|
|
2024-10-24 16:35:51 -04:00
|
|
|
return (
|
|
|
|
|
<BetterTooltip content="Toggle Sidebar" align="start">
|
2024-10-31 15:39:07 +05:30
|
|
|
<Button
|
|
|
|
|
onClick={toggleSidebar}
|
2024-11-05 14:16:27 +03:00
|
|
|
variant="outline"
|
2024-10-31 15:39:07 +05:30
|
|
|
className="md:px-2 md:h-fit"
|
|
|
|
|
>
|
2024-11-05 14:16:27 +03:00
|
|
|
<SidebarLeftIcon size={16} />
|
2024-10-31 15:39:07 +05:30
|
|
|
</Button>
|
2024-10-24 16:35:51 -04:00
|
|
|
</BetterTooltip>
|
|
|
|
|
);
|
|
|
|
|
}
|