@@ -8,7 +8,7 @@ import { dateOnlyToUtcMs, formatDateShortFromDateOnly } from "@/lib/date-only";
88import { ArrowLeft } from "lucide-react" ;
99
1010import { requireAuth } from "@/lib/auth" ;
11- import { AdminNavigation } from "@/components/admin/admin-navigation" ;
11+ import { AdminNavigation , type AdminNavigationGroup } from "@/components/admin/admin-navigation" ;
1212
1313const convex = new ConvexHttpClient ( process . env . NEXT_PUBLIC_CONVEX_URL ! ) ;
1414
@@ -44,61 +44,43 @@ export default async function ChallengeAdminLayout({
4444 challengeId : id as Id < "challenges" > ,
4545 } ) ;
4646
47- const navItems : { href : string ; label : string ; segment : string } [ ] = [
48- {
49- href : `/challenges/${ challenge . _id } /admin` ,
50- label : "Overview" ,
51- segment : "(overview)" ,
52- } ,
53- {
54- href : `/challenges/${ challenge . _id } /admin/settings` ,
55- label : "Settings" ,
56- segment : "settings" ,
57- } ,
58- {
59- href : `/challenges/${ challenge . _id } /admin/flagged-activities` ,
60- label : "Flagged" ,
61- segment : "flagged-activities" ,
62- } ,
63- {
64- href : `/challenges/${ challenge . _id } /admin/activity-types` ,
65- label : "Activity Types" ,
66- segment : "activity-types" ,
67- } ,
68- {
69- href : `/challenges/${ challenge . _id } /admin/integrations` ,
70- label : "Integrations" ,
71- segment : "integrations" ,
72- } ,
73- {
74- href : `/challenges/${ challenge . _id } /admin/strava-preview` ,
75- label : "Strava Preview" ,
76- segment : "strava-preview" ,
77- } ,
47+ const base = `/challenges/${ challenge . _id } /admin` ;
48+
49+ const navGroups : AdminNavigationGroup [ ] = [
7850 {
79- href : `/challenges/${ challenge . _id } /admin/achievements` ,
80- label : "Achievements" ,
81- segment : "achievements" ,
51+ label : "Monitor" ,
52+ items : [
53+ { href : base , label : "Overview" , segment : "(overview)" } ,
54+ { href : `${ base } /flagged-activities` , label : "Flagged" , segment : "flagged-activities" } ,
55+ ] ,
8256 } ,
8357 {
84- href : `/challenges/${ challenge . _id } /admin/mini-games` ,
85- label : "Mini Games" ,
86- segment : "mini-games" ,
58+ label : "Scoring" ,
59+ items : [
60+ { href : `${ base } /activity-types` , label : "Activity Types" , segment : "activity-types" } ,
61+ { href : `${ base } /integrations` , label : "Integrations" , segment : "integrations" } ,
62+ { href : `${ base } /achievements` , label : "Achievements" , segment : "achievements" } ,
63+ ] ,
8764 } ,
8865 {
89- href : `/challenges/${ challenge . _id } /admin/emails` ,
90- label : "Emails" ,
91- segment : "emails" ,
66+ label : "Engage" ,
67+ items : [
68+ { href : `${ base } /mini-games` , label : "Mini Games" , segment : "mini-games" } ,
69+ { href : `${ base } /emails` , label : "Emails" , segment : "emails" } ,
70+ ] ,
9271 } ,
9372 {
94- href : `/challenges/${ challenge . _id } /admin/participants` ,
95- label : "Participants" ,
96- segment : "participants" ,
73+ label : "People" ,
74+ items : [
75+ { href : `${ base } /participants` , label : "Participants" , segment : "participants" } ,
76+ { href : `${ base } /payments` , label : "Payments" , segment : "payments" } ,
77+ ] ,
9778 } ,
9879 {
99- href : `/challenges/${ challenge . _id } /admin/payments` ,
100- label : "Payments" ,
101- segment : "payments" ,
80+ label : "Configure" ,
81+ items : [
82+ { href : `${ base } /settings` , label : "Settings" , segment : "settings" } ,
83+ ] ,
10284 } ,
10385 ] ;
10486
@@ -156,7 +138,7 @@ export default async function ChallengeAdminLayout({
156138
157139 { /* Navigation Tabs */ }
158140 < div className = "border-t border-zinc-800/50 px-3" >
159- < AdminNavigation items = { navItems } />
141+ < AdminNavigation groups = { navGroups } />
160142 </ div >
161143 </ header >
162144
0 commit comments