bb-plane-fork/apps/web/ce/components/workspace-notifications/notification-card/content.ts
Vamsi Krishna 5499e49b72
[WEB-5574]chore: notification card refactor (#8234)
* chore: notification card refactor

* chore: moved base activity types to constants package
2025-12-24 20:32:50 +05:30

25 lines
1.2 KiB
TypeScript

import { replaceUnderscoreIfSnakeCase } from "@plane/utils";
import type { TNotificationContentMap } from "@/components/workspace-notifications/sidebar/notification-card/content";
// Additional notification content map for CE (empty - EE extends this)
export const ADDITIONAL_NOTIFICATION_CONTENT_MAP: TNotificationContentMap = {};
// Fallback action renderer for fields not in the map
export const renderAdditionalAction = (notificationField: string, verb: string | undefined) => {
const baseAction = !["comment", "archived_at"].includes(notificationField) ? verb : "";
return `${baseAction} ${replaceUnderscoreIfSnakeCase(notificationField)}`;
};
// Fallback value renderer for fields not in the map
export const renderAdditionalValue = (
_notificationField: string | undefined,
newValue: string | undefined,
_oldValue: string | undefined
) => newValue;
export const shouldShowConnector = (notificationField: string | undefined) =>
!["comment", "archived_at", "None", "assignees", "labels", "start_date", "target_date", "parent"].includes(
notificationField || ""
);
export const shouldRender = (notificationField: string | undefined, verb: string | undefined) => verb !== "deleted";