summaryrefslogtreecommitdiff
path: root/makima/frontend/src/components/directives/DirectiveList.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/components/directives/DirectiveList.tsx')
-rw-r--r--makima/frontend/src/components/directives/DirectiveList.tsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/makima/frontend/src/components/directives/DirectiveList.tsx b/makima/frontend/src/components/directives/DirectiveList.tsx
index 6393ea7..6a9c486 100644
--- a/makima/frontend/src/components/directives/DirectiveList.tsx
+++ b/makima/frontend/src/components/directives/DirectiveList.tsx
@@ -1,4 +1,6 @@
+import { useMemo } from "react";
import type { DirectiveSummary, DirectiveStatus } from "../../lib/api";
+import { useSupervisorQuestions } from "../../contexts/SupervisorQuestionsContext";
const STATUS_BADGE: Record<DirectiveStatus, { color: string; label: string }> = {
draft: { color: "text-[#7788aa] border-[#2a3a5a]", label: "DRAFT" },
@@ -16,6 +18,18 @@ interface DirectiveListProps {
}
export function DirectiveList({ directives, selectedId, onSelect, onCreate }: DirectiveListProps) {
+ const { pendingQuestions } = useSupervisorQuestions();
+
+ const questionsPerDirective = useMemo(() => {
+ const counts = new Map<string, number>();
+ for (const q of pendingQuestions) {
+ if (q.directiveId) {
+ counts.set(q.directiveId, (counts.get(q.directiveId) || 0) + 1);
+ }
+ }
+ return counts;
+ }, [pendingQuestions]);
+
return (
<div className="flex flex-col h-full">
<div className="flex items-center justify-between px-3 py-2 border-b border-dashed border-[rgba(117,170,252,0.2)]">
@@ -55,6 +69,9 @@ export function DirectiveList({ directives, selectedId, onSelect, onCreate }: Di
<span className="text-[12px] font-mono text-white truncate pr-2">
{d.title}
</span>
+ {questionsPerDirective.has(d.id) && (
+ <span className="inline-block w-2.5 h-2.5 rounded-full bg-amber-400 animate-pulse shrink-0" title={`${questionsPerDirective.get(d.id)} pending question(s)`} />
+ )}
<span
className={`text-[9px] font-mono ${badge.color} border rounded px-1.5 py-0.5 shrink-0`}
>