import { ConfirmDialog } from './confirm-dialog'

interface SignOutDialogProps {
  open: boolean
  onOpenChange: (open: boolean) => void
  /** Called when the user confirms sign-out. Perform the actual sign-out action here. */
  onConfirm?: () => void
}

export function SignOutDialog({ open, onOpenChange, onConfirm }: SignOutDialogProps) {
  return (
    <ConfirmDialog
      open={open}
      onOpenChange={onOpenChange}
      title='Sign out'
      desc='Are you sure you want to sign out? You will need to sign in again to access your account.'
      confirmText='Sign out'
      destructive
      handleConfirm={() => {
        onConfirm?.()
        onOpenChange(false)
      }}
      className='sm:max-w-sm'
    />
  )
}
