import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
} from '@/components/ui/alert-dialog'
import { useAtom } from 'jotai'
import { isCreateAiLimitReachedDialogOpenAtom } from '@/atoms/global'

const CreateReachedLimitDialog = () => {
  const [isCreateAiLimitReachedDialogOpen, setIsCreateAiLimitReachedDialogOpen] = useAtom(
    isCreateAiLimitReachedDialogOpenAtom
  )

  return (
    <AlertDialog
      open={isCreateAiLimitReachedDialogOpen}
      onOpenChange={setIsCreateAiLimitReachedDialogOpen}
    >
      <AlertDialogContent>
        <AlertDialogHeader>
          <AlertDialogTitle>Warning</AlertDialogTitle>
          <AlertDialogDescription>
            you have reached the maximum number of AI creations.
          </AlertDialogDescription>
        </AlertDialogHeader>
        <AlertDialogFooter>
          <AlertDialogAction>Got it</AlertDialogAction>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>
  )
}

export default CreateReachedLimitDialog
