diff options
Diffstat (limited to 'makima/frontend/src/components/NavStrip.tsx')
| -rw-r--r-- | makima/frontend/src/components/NavStrip.tsx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/makima/frontend/src/components/NavStrip.tsx b/makima/frontend/src/components/NavStrip.tsx index 117f4e1..4932427 100644 --- a/makima/frontend/src/components/NavStrip.tsx +++ b/makima/frontend/src/components/NavStrip.tsx @@ -1,4 +1,5 @@ import { useAuth } from "../contexts/AuthContext"; +import { useSupervisorQuestions } from "../contexts/SupervisorQuestionsContext"; import { RewriteLink } from "./RewriteLink"; interface NavLink { @@ -19,6 +20,8 @@ const NAV_LINKS: NavLink[] = [ export function NavStrip() { const { isAuthenticated, isAuthConfigured, signOut, user } = useAuth(); + const { pendingQuestions } = useSupervisorQuestions(); + const directiveQuestionCount = pendingQuestions.filter(q => q.directiveId).length; const handleSignOut = async () => { await signOut(); @@ -38,14 +41,18 @@ export function NavStrip() { </span> <div className="flex flex-wrap gap-2 items-center flex-1"> {NAV_LINKS.map((link) => ( - <RewriteLink - key={link.label} - to={link.href} - disabled={link.requiresAuth && !hasAccess} - external={link.external} - > - {link.label} - </RewriteLink> + <span key={link.label} className="relative inline-flex items-center"> + <RewriteLink + to={link.href} + disabled={link.requiresAuth && !hasAccess} + external={link.external} + > + {link.label} + </RewriteLink> + {link.label === "Directives" && directiveQuestionCount > 0 && ( + <span className="ml-0.5 inline-block w-2 h-2 rounded-full bg-amber-400 animate-pulse" title={`${directiveQuestionCount} pending question(s)`} /> + )} + </span> ))} </div> <div className="flex items-center gap-2 pl-2.5 border-l border-[rgba(117,170,252,0.35)]"> |
