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 { LayersIcon } from "@plane/ui";
|
2024-01-23 07:58:58 +00:00
|
|
|
import { useIssueDetail } from "hooks/store";
|
|
|
|
// components
|
|
|
|
import { IssueActivityBlockComponent } from "./";
|
|
|
|
// icons
|
|
|
|
|
|
|
|
type TIssueDefaultActivity = { activityId: string; ends: "top" | "bottom" | undefined };
|
|
|
|
|
|
|
|
export const IssueDefaultActivity: FC<TIssueDefaultActivity> = observer((props) => {
|
|
|
|
const { activityId, ends } = props;
|
|
|
|
// hooks
|
|
|
|
const {
|
|
|
|
activity: { getActivityById },
|
|
|
|
} = useIssueDetail();
|
|
|
|
|
|
|
|
const activity = getActivityById(activityId);
|
|
|
|
|
|
|
|
if (!activity) return <></>;
|
|
|
|
return (
|
|
|
|
<IssueActivityBlockComponent
|
|
|
|
activityId={activityId}
|
|
|
|
icon={<LayersIcon width={12} height={12} color="#6b7280" aria-hidden="true" />}
|
|
|
|
ends={ends}
|
|
|
|
>
|
|
|
|
<>{activity.verb === "created" ? " created the issue." : " deleted an issue."}</>
|
|
|
|
</IssueActivityBlockComponent>
|
|
|
|
);
|
|
|
|
});
|