26 lines
686 B
TypeScript
26 lines
686 B
TypeScript
import { ComponentProps } from 'react';
|
|
|
|
import { SidebarTrigger, useSidebar } from '@/components/ui/sidebar';
|
|
import { BetterTooltip } from '@/components/ui/tooltip';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
import { SidebarLeftIcon } from './icons';
|
|
import { Button } from './ui/button';
|
|
|
|
export function SidebarToggle({
|
|
className,
|
|
}: ComponentProps<typeof SidebarTrigger>) {
|
|
const { toggleSidebar } = useSidebar();
|
|
|
|
return (
|
|
<BetterTooltip content="Toggle Sidebar" align="start">
|
|
<Button
|
|
onClick={toggleSidebar}
|
|
variant="outline"
|
|
className="md:px-2 md:h-fit"
|
|
>
|
|
<SidebarLeftIcon size={16} />
|
|
</Button>
|
|
</BetterTooltip>
|
|
);
|
|
}
|