// next import Image from "next/image"; import { ChartBarIcon, ChatBubbleBottomCenterTextIcon, Squares2X2Icon, } from "@heroicons/react/24/outline"; import { addSpaceIfCamelCase, timeAgo } from "constants/common"; import { IState } from "types"; import { Spinner } from "ui"; type Props = { issueActivities: any[] | undefined; states: IState[] | undefined; }; const activityIcons = { state: , priority: , name: , description: , }; const IssueActivitySection: React.FC = ({ issueActivities, states }) => { return ( <> {issueActivities ? ( {issueActivities.map((activity) => { if (activity.field !== "updated_by") return ( {issueActivities.length > 1 ? ( ) : null} {activity.field ? ( {activityIcons[activity.field as keyof typeof activityIcons]} ) : ( {activity.actor_detail.avatar && activity.actor_detail.avatar !== "" ? ( ) : ( {activity.actor_detail.first_name.charAt(0)} )} )} {activity.actor_detail.first_name} {activity.actor_detail.last_name}{" "} {activity.verb}{" "} {activity.verb !== "created" ? ( {activity.field ?? "commented"} ) : ( " this issue" )} {timeAgo(activity.created_at)} {activity.verb !== "created" && ( From:{" "} {activity.field === "state" ? activity.old_value ? addSpaceIfCamelCase( states?.find((s) => s.id === activity.old_value)?.name ?? "" ) : "None" : activity.old_value} To:{" "} {activity.field === "state" ? activity.new_value ? addSpaceIfCamelCase( states?.find((s) => s.id === activity.new_value)?.name ?? "" ) : "None" : activity.new_value} )} ); })} ) : ( )} > ); }; export default IssueActivitySection;
{activity.actor_detail.first_name} {activity.actor_detail.last_name}{" "} {activity.verb}{" "} {activity.verb !== "created" ? ( {activity.field ?? "commented"} ) : ( " this issue" )}
{timeAgo(activity.created_at)}