[] = [
+ {
+ accessorKey: "action",
+ header: "Action",
+ cell: ({ row }) => (
+
+ )
+ },
+ {
+ accessorKey: "match",
+ header: "Match Type",
+ cell: ({ row }) => (
+
+ )
+ },
+ {
+ accessorKey: "value",
+ header: "Value",
+ cell: ({ row }) => (
+
+ updateRule(row.original.ruleId, {
+ value: e.target.value
+ })
+ }
+ />
+ )
+ },
+ {
+ id: "actions",
+ cell: ({ row }) => (
+
+
+
+ )
+ }
+ ];
+
+ const table = useReactTable({
+ data: rules,
+ columns,
+ getCoreRowModel: getCoreRowModel(),
+ getPaginationRowModel: getPaginationRowModel(),
+ getSortedRowModel: getSortedRowModel(),
+ getFilteredRowModel: getFilteredRowModel()
+ });
+
+ if (pageLoading) {
+ return <>>;
+ }
+
+ return (
+
+
+
+
+ Resource Rules Configuration
+
+
+ Configure rules to control access to your resource
+
+
+
+
+
+
+
+
+ {table.getHeaderGroups().map((headerGroup) => (
+
+ {headerGroup.headers.map((header) => (
+
+ {header.isPlaceholder
+ ? null
+ : flexRender(
+ header.column.columnDef.header,
+ header.getContext()
+ )}
+
+ ))}
+
+ ))}
+
+
+ {table.getRowModel().rows?.length ? (
+ table.getRowModel().rows.map((row) => (
+
+ {row.getVisibleCells().map((cell) => (
+
+ {flexRender(
+ cell.column.columnDef.cell,
+ cell.getContext()
+ )}
+
+ ))}
+
+ ))
+ ) : (
+
+
+ No rules. Add a rule using the form.
+
+
+ )}
+
+
+
+
+
+
+
+
+
+ );
+}
\ No newline at end of file