// src/features/admin-vendor-detail/ApproveAnywayDialog.tsx
// Lazy-loaded approve-anyway confirmation for VendorDetail. Renders the
// AlertDialog body (title/description/footer); the trigger button stays in
// the parent so the action surface remains visible without a fetch.

'use client';

import { useT } from '@/lib/i18n/react';
import {
  AlertDialog,
  AlertDialogContent,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogAction,
  AlertDialogCancel,
} from '@/components/ui/overlays/AlertDialog';

export interface ApproveAnywayDialogProps {
  open: boolean;
  onOpenChange: (open: boolean) => void;
  onConfirm: () => void;
}

export default function ApproveAnywayDialog({
  open,
  onOpenChange,
  onConfirm,
}: ApproveAnywayDialogProps) {
  const tAdmin = useT('admin');
  const tCommon = useT('common');

  return (
    <AlertDialog open={open} onOpenChange={onOpenChange}>
      <AlertDialogContent>
        <AlertDialogHeader>
          <AlertDialogTitle>{tAdmin('approve_anyway_confirm_title')}</AlertDialogTitle>
          <AlertDialogDescription>{tAdmin('approve_anyway_confirm_body')}</AlertDialogDescription>
        </AlertDialogHeader>
        <AlertDialogFooter>
          <AlertDialogAction onClick={onConfirm}>
            {tAdmin('approve_anyway_confirm_action')}
          </AlertDialogAction>
          <AlertDialogCancel>{tCommon('cancel')}</AlertDialogCancel>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>
  );
}
