chatbot-template/components/sidebar-toggle.tsx

25 lines
548 B
TypeScript
Raw Normal View History

'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"
onClick={() => {
toggleSidebar()
}}
>
2024-01-20 10:39:02 -06:00
<IconSidebar className="size-6" />
<span className="sr-only">Toggle Sidebar</span>
</Button>
)
}