export default function MenuDetail() { const { menuId } = useParams(); const { match } = JsonRules; const matchData = match.find((el) => el._id_menu === menuId)?._ids ?? []; const [show, setShow] = useState(true); const data = useMemo( () => [ //some headers .... { Header: 'Show', accessor: (row) => <button onClick={() => setShow(!show)}> {show ? <VisibilityIcon/> : <VisibilityOffIcon/> } </button> } ],[] ); ... return ( { show? <Table data = { matchData } columns = { data } initialState = { initialState } withCellBorder withRowBorder withSorting withPagination /> : null } ); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)