import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
} from '@/components/ui/alert-dialog';

type DiscardAccessTokenDraftProps = {
  onContinue: () => void;
  onDiscard: () => void;
};

export const DiscardAccessTokenDraft = ({
  onContinue,
  onDiscard,
}: DiscardAccessTokenDraftProps) => {
  return (
    <AlertDialog open>
      <AlertDialogContent>
        <AlertDialogHeader>
          <AlertDialogTitle>Do you want to discard the access token?</AlertDialogTitle>
          <AlertDialogDescription>
            If you discard now, any draft information will be lost.
          </AlertDialogDescription>
        </AlertDialogHeader>
        <AlertDialogFooter>
          <AlertDialogCancel onClick={() => onContinue()}>
            Continue creating token
          </AlertDialogCancel>
          <AlertDialogAction onClick={() => onDiscard()}>Discard draft token</AlertDialogAction>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>
  );
};
