Mounts L1EscalationsSection on EscalationQueuePage (Finding 2a — it was never rendered) and renders the correct fields: step.question ?? step.text, timeAgo, and the session problem_text (Finding 2b). ProposalDetail gates the /pilot link on source_session_id and shows an L1-source block for l1_session_id-sourced proposals (Finding 3 — was a broken /pilot/null link). Collapses the three near-identical intake handlers into one runIntake: "Use this flow" now passes near_miss.flow_id (Finding 4 — it previously re-suggested forever) and a navigate guard prevents /l1/walk/undefined; out_of_scope gains a "Walk it ad-hoc" button (Finding 5). Aligns L1-category permissions to owner+admin: usePermissions.canManageAccount includes account admins, User.account_role TS type gains 'admin', and a new ProtectedRoute requireAccountManager guard fronts the route (Finding 7). Drops the unused NextNodeRequest.acknowledged field. tsc -b + eslint + vite build clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { useState } from 'react'
|
|
import { AlertTriangle } from 'lucide-react'
|
|
import { EscalationQueue, EscalationMetricCard } from '@/components/flowpilot'
|
|
import { L1EscalationsSection } from '@/components/l1/L1EscalationsSection'
|
|
|
|
export default function EscalationQueuePage() {
|
|
const [count, setCount] = useState<number | null>(null)
|
|
|
|
return (
|
|
<div className="mx-auto max-w-4xl p-6 space-y-6">
|
|
<div className="flex items-center gap-3">
|
|
<span className="flex h-8 w-8 items-center justify-center rounded-lg bg-warning-dim">
|
|
<AlertTriangle size={16} className="text-warning" />
|
|
</span>
|
|
<div>
|
|
<h1 className="font-heading text-xl font-bold text-foreground">Escalation Queue</h1>
|
|
<p className="text-sm text-muted-foreground">
|
|
{count !== null && count > 0
|
|
? `${count} session${count !== 1 ? 's' : ''} waiting for pickup`
|
|
: 'Sessions from your team waiting for pickup'}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<EscalationMetricCard period="30d" />
|
|
|
|
<EscalationQueue onCountChange={setCount} />
|
|
|
|
{/* L1 AI-build handoffs (GET /l1/escalations). Renders nothing when empty,
|
|
so engineers without L1 escalations see no change. */}
|
|
<L1EscalationsSection />
|
|
</div>
|
|
)
|
|
}
|