import { Button } from "@mui/material";
import { Dispatch, FC, SetStateAction } from "react";

import { hideColumns } from "../../lib";

export const ButtonCheckAll: FC<IProps> = ({ setHidden }) => {
	function onClick() {
		setHidden([]);
		hideColumns([]);
	}

	return (
		<Button
			onClick={onClick}
			size={"small"}
			sx={{ textTransform: "none" }}
			variant={"contained"}
		>
			Check all
		</Button>
	);
};

interface IProps {
	setHidden: Dispatch<SetStateAction<string[]>>;
}
