import { Box } from "@mui/material";
import Edit from "./Edit";
import Delete from "./Delete";
import { useAuth } from "@/lib/contexts/auth";

const RowActions = ({ row, mutate }) => {
    const { user } = useAuth();

    return (
        <Box sx={{ display: "flex", gap: 1 }}>
            {row.original.state_id == 5 && user.id == row.original.user_id && (
                <>
                    <Edit mutate={mutate} row={row} />
                    <Delete mutate={mutate} rowId={row.original.id} />
                </>
            )}
        </Box>
    );
};
export default RowActions;
