2026-02-14 15:26:42 +01:00
|
|
|
'use client'
|
|
|
|
|
|
Observer platform redesign Phase 4: migrate charts to Tremor, redesign all pages
- Migrate 9 chart components from Nivo to @tremor/react (BarChart, AreaChart, DonutChart, ScatterChart)
- Remove @nivo/*, @react-spring/web dependencies (45 packages removed)
- Redesign dashboard: 6 stat tiles, competition pipeline, score distribution, juror workload, activity feed
- Add new /observer/projects page with search, filters, sorting, pagination, CSV export
- Restructure reports page from 5 tabs to 3 (Progress, Jurors, Scores & Analytics) with per-tab CSV export
- Redesign project detail: breadcrumb nav, score card header, 3-tab layout (Overview/Evaluations/Files)
- Update loading skeletons to match new layouts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 21:45:01 +01:00
|
|
|
import { BarChart3, Home, FolderKanban } from 'lucide-react'
|
2026-02-14 15:26:42 +01:00
|
|
|
import { RoleNav, type NavItem, type RoleNavUser } from '@/components/layouts/role-nav'
|
2026-02-20 22:45:56 +01:00
|
|
|
import { useEditionContext } from '@/components/observer/observer-edition-context'
|
|
|
|
|
import {
|
|
|
|
|
Select,
|
|
|
|
|
SelectContent,
|
|
|
|
|
SelectItem,
|
|
|
|
|
SelectTrigger,
|
|
|
|
|
SelectValue,
|
|
|
|
|
} from '@/components/ui/select'
|
2026-02-14 15:26:42 +01:00
|
|
|
|
|
|
|
|
interface ObserverNavProps {
|
|
|
|
|
user: RoleNavUser
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-20 22:45:56 +01:00
|
|
|
function EditionSelector() {
|
|
|
|
|
const { programs, selectedProgramId, setSelectedProgramId } = useEditionContext()
|
|
|
|
|
|
|
|
|
|
if (programs.length <= 1) return null
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Select value={selectedProgramId} onValueChange={setSelectedProgramId}>
|
|
|
|
|
<SelectTrigger className="w-full md:w-[180px]">
|
|
|
|
|
<SelectValue placeholder="Select edition" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
{programs.map((p) => (
|
|
|
|
|
<SelectItem key={p.id} value={p.id}>
|
|
|
|
|
{p.year ? `${p.year} Edition` : p.name ?? p.id}
|
|
|
|
|
</SelectItem>
|
|
|
|
|
))}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-14 15:26:42 +01:00
|
|
|
export function ObserverNav({ user }: ObserverNavProps) {
|
|
|
|
|
const navigation: NavItem[] = [
|
|
|
|
|
{
|
|
|
|
|
name: 'Dashboard',
|
|
|
|
|
href: '/observer',
|
|
|
|
|
icon: Home,
|
|
|
|
|
},
|
Observer platform redesign Phase 4: migrate charts to Tremor, redesign all pages
- Migrate 9 chart components from Nivo to @tremor/react (BarChart, AreaChart, DonutChart, ScatterChart)
- Remove @nivo/*, @react-spring/web dependencies (45 packages removed)
- Redesign dashboard: 6 stat tiles, competition pipeline, score distribution, juror workload, activity feed
- Add new /observer/projects page with search, filters, sorting, pagination, CSV export
- Restructure reports page from 5 tabs to 3 (Progress, Jurors, Scores & Analytics) with per-tab CSV export
- Redesign project detail: breadcrumb nav, score card header, 3-tab layout (Overview/Evaluations/Files)
- Update loading skeletons to match new layouts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 21:45:01 +01:00
|
|
|
{
|
|
|
|
|
name: 'Projects',
|
|
|
|
|
href: '/observer/projects',
|
|
|
|
|
icon: FolderKanban,
|
|
|
|
|
},
|
2026-02-14 15:26:42 +01:00
|
|
|
{
|
|
|
|
|
name: 'Reports',
|
|
|
|
|
href: '/observer/reports',
|
|
|
|
|
icon: BarChart3,
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<RoleNav
|
|
|
|
|
navigation={navigation}
|
|
|
|
|
roleName="Observer"
|
|
|
|
|
user={user}
|
|
|
|
|
basePath="/observer"
|
2026-02-20 22:45:56 +01:00
|
|
|
editionSelector={<EditionSelector />}
|
2026-02-14 15:26:42 +01:00
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|