import { Stack } from "@mui/material";
import StepOne from "./Form/StepOne";
import PrintExcel from "./ExcelPrint";
import { usePermissions } from "@/lib/hooks/usePermissions";
import Learn from "./Learn";

const Toolbar = ({ table, filterData, mutate }) => {
    const { data: userPermissions } = usePermissions();
    const hasCreatePermission = userPermissions?.includes("add-safety-and-privacy");
    return (
        <Stack direction={"row"} spacing={1}>
            <PrintExcel filterData={filterData} table={table} />
            {hasCreatePermission && <StepOne mutate={mutate} />}
            <Learn />
        </Stack>
    );
};
export default Toolbar;
