2024-06-10 09:43:10 +00:00
|
|
|
"use client";
|
|
|
|
|
2024-01-23 07:58:58 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
import { observer } from "mobx-react";
|
2024-02-28 11:23:26 +00:00
|
|
|
import { RotateCcw } from "lucide-react";
|
2024-01-23 07:58:58 +00:00
|
|
|
// hooks
|
2024-03-06 13:09:14 +00:00
|
|
|
import { ArchiveIcon } from "@plane/ui";
|
2024-03-19 14:38:35 +00:00
|
|
|
import { useIssueDetail } from "@/hooks/store";
|
2024-01-23 07:58:58 +00:00
|
|
|
// components
|
|
|
|
import { IssueActivityBlockComponent } from "./";
|
2024-02-28 11:23:26 +00:00
|
|
|
// ui
|
2024-01-23 07:58:58 +00:00
|
|
|
|
|
|
|
type TIssueArchivedAtActivity = { activityId: string; ends: "top" | "bottom" | undefined };
|
|
|
|
|
|
|
|
export const IssueArchivedAtActivity: FC<TIssueArchivedAtActivity> = observer((props) => {
|
|
|
|
const { activityId, ends } = props;
|
|
|
|
// hooks
|
|
|
|
const {
|
|
|
|
activity: { getActivityById },
|
|
|
|
} = useIssueDetail();
|
|
|
|
|
|
|
|
const activity = getActivityById(activityId);
|
|
|
|
|
|
|
|
if (!activity) return <></>;
|
2024-02-28 11:23:26 +00:00
|
|
|
|
2024-01-23 07:58:58 +00:00
|
|
|
return (
|
|
|
|
<IssueActivityBlockComponent
|
2024-02-28 11:23:26 +00:00
|
|
|
icon={
|
|
|
|
activity.new_value === "restore" ? (
|
|
|
|
<RotateCcw className="h-3.5 w-3.5" color="#6b7280" aria-hidden="true" />
|
|
|
|
) : (
|
|
|
|
<ArchiveIcon className="h-3.5 w-3.5" color="#6b7280" aria-hidden="true" />
|
|
|
|
)
|
|
|
|
}
|
2024-01-23 07:58:58 +00:00
|
|
|
activityId={activityId}
|
|
|
|
ends={ends}
|
2024-02-28 11:23:26 +00:00
|
|
|
customUserName={activity.new_value === "archive" ? "Plane" : undefined}
|
2024-01-23 07:58:58 +00:00
|
|
|
>
|
2024-02-28 11:23:26 +00:00
|
|
|
{activity.new_value === "restore" ? "restored the issue" : "archived the issue"}.
|
2024-01-23 07:58:58 +00:00
|
|
|
</IssueActivityBlockComponent>
|
|
|
|
);
|
|
|
|
});
|