+
+
+ {postmortem ? (
+
+ {postmortem.status}
+
+ ) : (
+ No postmortem yet
+ )}
+ {postmortem?.draftedBy === "agent" ? (
+ Drafted by the agent
+ ) : null}
+
+ {agentAllowed && !approved ? (
+
+ ) : null}
+
+
+
+ Write
+ Preview
+
+
+
+
+
+
+
+
+
+ {postmortem && !approved ? (
+ <>
+
+
+ >
+ ) : null}
+
+ {approved && incident.closedAt === null ? (
+
+ Approved. Close the incident from the panel on the right.
+
+ ) : null}
+
+ );
+}
diff --git a/apps/dashboard/src/components/incidents/incident-properties.tsx b/apps/dashboard/src/components/incidents/incident-properties.tsx
index 125f6bbe..335acaae 100644
--- a/apps/dashboard/src/components/incidents/incident-properties.tsx
+++ b/apps/dashboard/src/components/incidents/incident-properties.tsx
@@ -56,6 +56,9 @@ export function IncidentProperties({ incident }: { incident: Incident }) {
const router = useRouter();
const queryClient = useQueryClient();
const { data: members } = useQuery(trpc.member.list.queryOptions());
+ const { data: postmortem } = useQuery(
+ trpc.incident.getPostmortem.queryOptions({ id: incident.id }),
+ );
const [startedAt, setStartedAt] = useState(toLocalInput(incident.startedAt));
const closed = incident.closedAt !== null;
@@ -202,16 +205,27 @@ export function IncidentProperties({ incident }: { incident: Incident }) {