diff --git a/apps/web/core/components/comments/quick-actions.tsx b/apps/web/core/components/comments/quick-actions.tsx index 8facbe0abfc..eff40eab0b1 100644 --- a/apps/web/core/components/comments/quick-actions.tsx +++ b/apps/web/core/components/comments/quick-actions.tsx @@ -78,45 +78,43 @@ export const CommentQuickActions = observer(function CommentQuickActions(props: icon: TrashIcon, shouldRender: canDelete, }, - ]; + ].filter((item) => item.shouldRender !== false); }, [t, setEditMode, canEdit, showCopyLinkOption, activityOperations, comment, showAccessSpecifier, canDelete] ); + if (MENU_ITEMS.length === 0) return null; + return ( } closeOnSelect> - {MENU_ITEMS.map((item) => { - if (item.shouldRender === false) return null; - - return ( - item.action()} - className={cn( - "flex items-center gap-2", - { - "text-placeholder": item.disabled, - }, - item.className + {MENU_ITEMS.map((item) => ( + item.action()} + className={cn( + "flex items-center gap-2", + { + "text-placeholder": item.disabled, + }, + item.className + )} + disabled={item.disabled} + > + {item.icon && } +
+
{item.title}
+ {item.description && ( +

+ {item.description} +

)} - disabled={item.disabled} - > - {item.icon && } -
-
{item.title}
- {item.description && ( -

- {item.description} -

- )} -
- - ); - })} +
+
+ ))}
); });