import useSWR from "swr"; import { useRouter } from "next/router"; import Link from "next/link"; // services import userService from "services/user.service"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; import SettingsNavbar from "layouts/settings-navbar"; // components import { ActivityIcon, ActivityMessage } from "components/core"; import RemirrorRichTextEditor from "components/rich-text-editor"; // icons import { ArrowTopRightOnSquareIcon, ChatBubbleLeftEllipsisIcon } from "@heroicons/react/24/outline"; // ui import { Icon, Loader } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; // fetch-keys import { USER_ACTIVITY } from "constants/fetch-keys"; // helper import { timeAgo } from "helpers/date-time.helper"; const ProfileActivity = () => { const router = useRouter(); const { workspaceSlug } = router.query; const { data: userActivity } = useSWR(USER_ACTIVITY, () => userService.getUserActivity()); if (!userActivity) { return ( ); } return ( } > Profile Settings This information will be visible to only you. {userActivity && userActivity.results.length > 0 && ( {userActivity.results.map((activityItem: any, activityIdx: number) => { if (activityItem.field === "comment") { return ( {activityItem.field ? ( activityItem.new_value === "restore" && ( ) ) : activityItem.actor_detail.avatar && activityItem.actor_detail.avatar !== "" ? ( ) : ( {activityItem.actor_detail.first_name.charAt(0)} )} {activityItem.actor_detail.first_name} {activityItem.actor_detail.is_bot ? "Bot" : " " + activityItem.actor_detail.last_name} Commented {timeAgo(activityItem.created_at)} ); } const message = activityItem.verb === "created" && activityItem.field !== "cycles" && activityItem.field !== "modules" && activityItem.field !== "attachment" && activityItem.field !== "link" && activityItem.field !== "estimate" ? ( created{" "} this issue. ) : activityItem.field ? ( ) : ( "created the issue." ); if ("field" in activityItem && activityItem.field !== "updated_by") { return ( {userActivity.results.length > 1 && activityIdx !== userActivity.results.length - 1 ? ( ) : null} <> {activityItem.field ? ( activityItem.new_value === "restore" ? ( ) : ( ) ) : activityItem.actor_detail.avatar && activityItem.actor_detail.avatar !== "" ? ( ) : ( {activityItem.actor_detail.first_name.charAt(0)} )} {activityItem.field === "archived_at" && activityItem.new_value !== "restore" ? ( Plane ) : activityItem.actor_detail.is_bot ? ( {activityItem.actor_detail.first_name} Bot ) : ( {activityItem.actor_detail.first_name}{" "} {activityItem.actor_detail.last_name} )}{" "} {message}{" "} {timeAgo(activityItem.created_at)} > ); } })} )} ); }; export default ProfileActivity;
This information will be visible to only you.
Commented {timeAgo(activityItem.created_at)}