import React from 'react';
import { X } from 'lucide-react';

interface ConfirmMarkModalProps {
  open: boolean;
  count: number;
  onCancel: () => void;
  onConfirm: () => void;
}

export function ConfirmMarkModal({ open, count, onCancel, onConfirm }: ConfirmMarkModalProps) {
  if (!open) return null;

  return (
    <div className="vm-modal-backdrop" role="presentation" onClick={onCancel}>
      <div
        className="vm-modal vm-modal-sm"
        role="dialog"
        aria-modal="true"
        aria-labelledby="confirm-mark-title"
        onClick={(e) => e.stopPropagation()}
      >
        <header className="vm-modal-header">
          <h2 id="confirm-mark-title" className="vm-modal-title">标记为已确认</h2>
          <button type="button" className="vm-modal-close" onClick={onCancel} aria-label="关闭">
            <X size={18} aria-hidden />
          </button>
        </header>
        <div className="vm-modal-body">
          <p className="ldb-confirm-text">
            确认后的数据只有主管才能继续进行修改，是否确认数据准确无误？
          </p>
          <p className="ldb-confirm-meta">已选择 {count} 条草稿记录</p>
        </div>
        <footer className="vm-modal-footer">
          <button type="button" className="vm-btn vm-btn-ghost" onClick={onCancel}>取消</button>
          <button type="button" className="vm-btn vm-btn-primary" onClick={onConfirm}>确认</button>
        </footer>
      </div>
    </div>
  );
}
