import { Dialog, DialogTitle } from "@mui/material";
import RenderActionForm from "./RenderActionForm";

const ActionDialog = ({ open, type, rowData, onClose, mutate }) => {
    const actionLabel = {
        reject_request: "رد درخواست",
        confirm_request: "تایید درخواست",
        refer_request: "ارجاع درخواست",
    }[type];

    return (
        <Dialog open={open} fullWidth maxWidth="xs" onClose={onClose}>
            <DialogTitle>{actionLabel}</DialogTitle>

            <RenderActionForm type={type} rowData={rowData} mutate={mutate} onClose={onClose} />
        </Dialog>
    );
};

export default ActionDialog;
