diff --git a/apps/app/helpers/activity.helper.tsx b/apps/app/components/core/activity.tsx similarity index 62% rename from apps/app/helpers/activity.helper.tsx rename to apps/app/components/core/activity.tsx index af5d9bf12..078941b02 100644 --- a/apps/app/helpers/activity.helper.tsx +++ b/apps/app/components/core/activity.tsx @@ -1,5 +1,7 @@ +import { useRouter } from "next/router"; + // icons -import { Icon } from "components/ui"; +import { Icon, Tooltip } from "components/ui"; import { Squares2X2Icon } from "@heroicons/react/24/outline"; import { BlockedIcon, BlockerIcon } from "components/icons"; // helpers @@ -8,26 +10,65 @@ import { capitalizeFirstLetter } from "helpers/string.helper"; // types import { IIssueActivity } from "types"; -export const activityDetails: { +const IssueLink = ({ activity }: { activity: IIssueActivity }) => { + const router = useRouter(); + const { workspaceSlug } = router.query; + + return ( + + + {activity.issue_detail + ? `${activity.project_detail.identifier}-${activity.issue_detail.sequence_id}` + : "Issue"} + + + + ); +}; + +const activityDetails: { [key: string]: { - message: (activity: IIssueActivity) => React.ReactNode; + message: (activity: IIssueActivity, showIssue: boolean) => React.ReactNode; icon: React.ReactNode; }; } = { assignees: { - message: (activity) => { + message: (activity, showIssue) => { if (activity.old_value === "") return ( <> added a new assignee{" "} - {activity.new_value}. + {activity.new_value} + {showIssue && ( + <> + {" "} + to + + )} + . ); else return ( <> removed the assignee{" "} - {activity.old_value}. + {activity.old_value} + {showIssue && ( + <> + {" "} + from + + )} + . ); }, @@ -41,7 +82,7 @@ export const activityDetails: { icon: