import { usePermissions } from "@/lib/hooks/usePermissions";
import { Box } from "@mui/material";
import Edit from "./Edit";

const RowActions = ({ row, mutate }) => {
    const { data: userPermissions } = usePermissions();
    const hasEditPermission = userPermissions.some((item) => ["update-machine"].includes(item));
    return (
        <Box sx={{ display: "flex", gap: 1 }}>
            {hasEditPermission && <Edit row={row} mutate={mutate} rowId={row.getValue("id")} />}
        </Box>
    );
};
export default RowActions;
