import {Box} from "@mui/material";
import UpdateForm from "@/components/dashboard/bank-management/Form/Update";
import EditForm from "@/components/dashboard/bank-management/Form/Edit";
import RejectForm from "@/components/dashboard/bank-management/Form/Reject";

const TableRow = ({row, mutate}) => {
    return (
        <Box sx={{display: "flex", flexWrap: "nowrap", gap: "8px"}}>
            {(row.original.bank_status == 0 || (row.original.bank_status == 1 && row.original.bank_state == 8)) && (
                <UpdateForm
                    rowId={row.getValue("id")}
                    mutate={mutate}
                />
            )}
            {
                row.original.bank_state == 8 && (
                    <RejectForm
                        rowId={row.getValue("id")}
                        mutate={mutate}
                    />
                )
            }
            <EditForm
                rowId={row.getValue("id")}
                mutate={mutate}
                row={row}
            />
        </Box>
    );
};

export default TableRow;
