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

export interface StandardizeConfirmDialogProps {
  open: boolean;
  onOpenChange: (open: boolean) => void;
  /** 待标准化条数（来自当前批次或选中行） */
  totalRows: number;
  /** 当前标准化任务的执行方式。新任务固定为在线执行，后端统一使用 MiMo 批量标准化并降级 DeepSeek。 */
  executionMode: 'online' | 'offline';
  /** 用户确认时触发；调用方负责关闭弹窗 + 后续 mutation */
  onConfirm: () => void;
}

export function StandardizeConfirmDialog({
  open,
  onOpenChange,
  totalRows,
  executionMode: _executionMode,
  onConfirm,
}: StandardizeConfirmDialogProps) {
  return (
    <AlertDialog open={open} onOpenChange={onOpenChange}>
      <AlertDialogContent>
        <AlertDialogHeader>
          <AlertDialogTitle>确认执行 AI 标准化</AlertDialogTitle>
          <AlertDialogDescription asChild>
            <div className="space-y-2 text-sm text-muted-foreground">
              <p>
                本次将对{' '}
                <span className="font-semibold text-foreground">{totalRows}</span> 条数据执行标准化。
              </p>
            </div>
          </AlertDialogDescription>
        </AlertDialogHeader>
        <AlertDialogFooter>
          <AlertDialogCancel>取消</AlertDialogCancel>
          <AlertDialogAction
            className="bg-gradient-to-r from-violet-500 to-indigo-500 hover:from-violet-600 hover:to-indigo-600 text-white"
            onClick={onConfirm}
          >
            确定
          </AlertDialogAction>
        </AlertDialogFooter>
      </AlertDialogContent>
    </AlertDialog>
  );
}
