2023-12-04 12:42:53 -05:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
|
|
import * as React from 'react'
|
|
|
|
|
|
|
|
|
|
import { useSidebar } from '@/lib/hooks/use-sidebar'
|
|
|
|
|
import { Button } from '@/components/ui/button'
|
|
|
|
|
import { IconSidebar } from '@/components/ui/icons'
|
|
|
|
|
|
|
|
|
|
export function SidebarToggle() {
|
|
|
|
|
const { toggleSidebar } = useSidebar()
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
2024-01-20 10:39:02 -06:00
|
|
|
className="-ml-2 hidden size-9 p-0 lg:flex"
|
2023-12-04 12:42:53 -05:00
|
|
|
onClick={() => {
|
|
|
|
|
toggleSidebar()
|
|
|
|
|
}}
|
|
|
|
|
>
|
2024-01-20 10:39:02 -06:00
|
|
|
<IconSidebar className="size-6" />
|
2023-12-04 12:42:53 -05:00
|
|
|
<span className="sr-only">Toggle Sidebar</span>
|
|
|
|
|
</Button>
|
|
|
|
|
)
|
|
|
|
|
}
|