'use client'

import { twMerge } from "tailwind-merge"
import { BsFillInfoCircleFill } from "react-icons/bs";


export default function ClearAfterFlowConfirmModal({ open, onCancel, onConfirm }: { open: boolean, onClose: () => void }) {

  return (
    <dialog className={twMerge("modal", open ? "modal-open" : "")}>
      <div className="modal-box pb-5">
        <h3 className="font-bold text-lg flex items-center gap-4">
          <BsFillInfoCircleFill />检测到当前步骤已进行过，请选择
        </h3>
        <div className="modal-action">
          <form method="dialog" className="flex gap-2">
            <button className="btn btn-sm" onClick={onCancel}>取消</button>
            <button className="btn btn-sm btn-secondary" onClick={() => onConfirm('not_clear')}>
              保留信息并继续
            </button>
            <button className="btn btn-sm btn-primary" onClick={() => onConfirm('clear')}>
              此节点后重新开始并继续
            </button>
          </form>
        </div>
      </div>
    </dialog>
  )
}