2024-01-23 07:58:58 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
import { observer } from "mobx-react";
|
|
|
|
// hooks
|
2024-03-06 13:09:14 +00:00
|
|
|
import { DoubleCircleIcon } 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, IssueLink } from "./";
|
|
|
|
// icons
|
|
|
|
|
|
|
|
type TIssueStateActivity = { activityId: string; showIssue?: boolean; ends: "top" | "bottom" | undefined };
|
|
|
|
|
|
|
|
export const IssueStateActivity: FC<TIssueStateActivity> = observer((props) => {
|
|
|
|
const { activityId, showIssue = true, ends } = props;
|
|
|
|
// hooks
|
|
|
|
const {
|
|
|
|
activity: { getActivityById },
|
|
|
|
} = useIssueDetail();
|
|
|
|
|
|
|
|
const activity = getActivityById(activityId);
|
|
|
|
|
|
|
|
if (!activity) return <></>;
|
|
|
|
return (
|
|
|
|
<IssueActivityBlockComponent
|
|
|
|
icon={<DoubleCircleIcon className="h-4 w-4 flex-shrink-0" />}
|
|
|
|
activityId={activityId}
|
|
|
|
ends={ends}
|
|
|
|
>
|
|
|
|
<>
|
|
|
|
set the state to <span className="font-medium text-custom-text-100">{activity.new_value}</span>
|
|
|
|
{showIssue ? ` for ` : ``}
|
|
|
|
{showIssue && <IssueLink activityId={activityId} />}.
|
|
|
|
</>
|
|
|
|
</IssueActivityBlockComponent>
|
|
|
|
);
|
|
|
|
});
|