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

interface Props {
  open: boolean;
  onOpenChange: (open: boolean) => void;
  onConfirm: () => void;
  isCurrentSession: boolean;
}

export function SessionRevokeConfirmDialog({ 
  open, 
  onOpenChange, 
  onConfirm, 
  isCurrentSession 
}: Props) {
  return (
    <AlertDialog open={open} onOpenChange={onOpenChange}>
      <AlertDialogContent>
        <AlertDialogHeader>
          <AlertDialogTitle>Revoke Session?</AlertDialogTitle>
          <AlertDialogDescription>
            {isCurrentSession ? (
              <>
                This is your current session. Revoking it will sign you out immediately
                and you'll need to log in again.
              </>
            ) : (
              <>
                This will immediately end the selected session. The device using that
                session will be signed out.
              </>
            )}
          </AlertDialogDescription>
        </AlertDialogHeader>
        <AlertDialogFooter>
          <AlertDialogCancel>Cancel</AlertDialogCancel>
          <AlertDialogAction onClick={onConfirm} className="bg-destructive hover:bg-destructive/90">
            {isCurrentSession ? 'Sign Out' : 'Revoke Session'}
          </AlertDialogAction>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>
  );
}
