Skip to content

Commit

Permalink
do not render actions if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
devjoaov committed Jun 18, 2024
1 parent 6224854 commit cf7330e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/DataTable/DataTableRowActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { DynamicActionComponent } from "./DynamicActionComponent";
export const DataTableRowActions = ({ row, column }) => {
const actions = row.original.actions || column.columnDef.actions;

if (!actions?.length) return null;

const filteredActions = actions.filter(
({ condition_key, condition_value }) => {
if (!condition_key && !condition_value) return true;
Expand All @@ -21,8 +23,6 @@ export const DataTableRowActions = ({ row, column }) => {
}
);

if (!actions?.length) return null;

if (filteredActions?.length === 0) return null;

return (
Expand Down

0 comments on commit cf7330e

Please sign in to comment.