[WEB-4094]chore: workspace notifications refactor (#7061)

* chore: workspace notifications refactor

* fix: url params

* fix: added null checks to avoid run time errors

* fix: notifications header color fix
This commit is contained in:
Vamsi Krishna 2025-06-09 15:33:57 +05:30 committed by GitHub
parent 1f1b421735
commit 07e937cd8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 273 additions and 208 deletions

View file

@ -0,0 +1,25 @@
import { EIssueServiceType } from "@plane/constants";
import { IWorkItemPeekOverview } from "@plane/types";
import { IssuePeekOverview } from "@/components/issues";
import { useIssueDetail } from "@/hooks/store";
import { TPeekIssue } from "@/store/issue/issue-details/root.store";
export type TNotificationPreview = {
isWorkItem: boolean;
PeekOverviewComponent: React.ComponentType<IWorkItemPeekOverview>;
setPeekWorkItem: (peekIssue: TPeekIssue | undefined) => void;
};
/**
* This function returns if the current active notification is related to work item or an epic.
* @returns isWorkItem: boolean, peekOverviewComponent: IWorkItemPeekOverview, setPeekWorkItem
*/
export const useNotificationPreview = (): TNotificationPreview => {
const { peekIssue, setPeekIssue } = useIssueDetail(EIssueServiceType.ISSUES);
return {
isWorkItem: Boolean(peekIssue),
PeekOverviewComponent: IssuePeekOverview,
setPeekWorkItem: setPeekIssue,
};
};