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

const Toolbar = ({ table, filterData, mutate }) => {
    const { data: userPermissions } = usePermissions();
    const hasAddPermission = userPermissions.some((item) => ["add-tollhouse", "add-tollhouse-province"].includes(item));
    return <Box sx={{ display: "flex", gap: 1 }}>{hasAddPermission && <CreateTollHouse mutate={mutate} />}</Box>;
};
export default Toolbar;
