Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 6x 6x 1x 6x 6x 2x 6x | import OurTable, { ButtonColumn } from "../OurTable"; import { hasRole } from "../../utils/currentUser"; export default function MenuItemTable({ menuItems, currentUser }) { const testid = "MenuItemTable"; const reviewCallback = async (_cell) => { alert("Reviews coming soon!"); }; const columns = [ { Header: "Item Name", accessor: "name", }, { Header: "Station", accessor: "station", }, ]; if (hasRole(currentUser, "ROLE_USER")) { columns.push( ButtonColumn("Review Item", "warning", reviewCallback, testid), ); } return <OurTable columns={columns} data={menuItems} testid={testid} />; } |