"use client"; import { FormEvent, useState } from "react"; import Modal from "../ui/Modal"; type ApprovalActionModalProps = { isOpen: boolean; mode: "approve" | "reject"; title: string; onSubmit: (notes?: string, checkerRole?: string) => Promise; onClose: () => void; }; export default function ApprovalActionModal({ isOpen, mode, title, onSubmit, onClose }: ApprovalActionModalProps) { const [notes, setNotes] = useState(""); const [checkerRole, setCheckerRole] = useState(""); const [loading, setLoading] = useState(false); const handleSubmit = async (e: FormEvent) => { e.preventDefault(); setLoading(true); try { await onSubmit(notes, checkerRole || undefined); } finally { setLoading(false); } }; return (