'use client'
import { useState } from 'react'
import { Bot } from 'lucide-react'
import { AskAIDialog } from './AskAIDialog'
import { useAccess } from '@lib/accessControl'
export function AskAIButton() {
const [open, setOpen] = useState(false)
const [minimized, setMinimized] = useState(false)
const { allowed, isLoading } = useAccess({ allowGuests: true })
if (!allowed && !isLoading) {
return null
}
return (
<>
{!open && (
)}
{
setOpen(false)
setMinimized(true)
}}
onEnd={() => {
setOpen(false)
setMinimized(false)
}}
/>
>
)
}