@@ -4,7 +4,7 @@ import { useMemo, useState } from 'react';
44
55import Link from 'next/link' ;
66
7- import { ArrowRight , BookOpen , Map as MapIcon , TrendingUp , Users , Zap } from 'lucide-react' ;
7+ import { ArrowRight , BookOpen , Map as MapIcon , TrendingUp , Users , Zap } from 'lucide-react' ;
88
99import { useActors } from '@/features/actors/queries' ;
1010import { CasChip } from '@/features/dashboard/components/CasChip' ;
@@ -56,7 +56,21 @@ export function MobileOverview() {
5656 const totalStories = stories . length ;
5757 const critCount = recentEvents . filter ( e => e . severity === 'CRITICAL' ) . length ;
5858 const [ expandedSummary , setExpandedSummary ] = useState ( false ) ;
59- const [ expandedEvents , setExpandedEvents ] = useState < Set < string > > ( new Set ( ) ) ;
59+ const feedHref = ( eventId ?: string ) => {
60+ const params = new URLSearchParams ( ) ;
61+ if ( latestDay ) params . set ( 'day' , latestDay ) ;
62+ if ( eventId ) params . set ( 'event' , eventId ) ;
63+ const qs = params . toString ( ) ;
64+ return qs ? `/dashboard/feed?${ qs } ` : '/dashboard/feed' ;
65+ } ;
66+ const mapHref = ( storyId ?: string ) => {
67+ const params = new URLSearchParams ( ) ;
68+ if ( storyId ) params . set ( 'story' , storyId ) ;
69+ const qs = params . toString ( ) ;
70+ return qs ? `/dashboard/map?${ qs } ` : '/dashboard/map' ;
71+ } ;
72+ const actorsHref = latestDay ? `/dashboard/actors?day=${ latestDay } ` : '/dashboard/actors' ;
73+ const briefHref = latestDay ? `/dashboard/brief?day=${ latestDay } ` : '/dashboard/brief' ;
6074
6175 return (
6276 < div className = "flex-1 min-h-0 overflow-y-auto bg-[var(--bg-1)] safe-pb" >
@@ -91,7 +105,7 @@ export function MobileOverview() {
91105 ) }
92106
93107 { /* ── GO TO MAP hero ── */ }
94- < Link href = "/dashboard/map" className = "no-underline" >
108+ < Link href = { mapHref ( ) } className = "no-underline" >
95109 < div className = "safe-px my-3 py-4 bg-[var(--blue-dim)] border border-[var(--blue)] flex items-center justify-between" >
96110 < div className = "flex items-center gap-3" >
97111 < MapIcon size = { 20 } strokeWidth = { 2 } className = "text-[var(--blue-l)]" />
@@ -123,15 +137,15 @@ export function MobileOverview() {
123137 < div className = "border-t border-[var(--bd)]" >
124138 < div className = "flex items-center justify-between safe-px py-2 bg-[var(--bg-2)] border-b border-[var(--bd)]" >
125139 < span className = "section-title" > Latest Events</ span >
126- < Link href = "/dashboard/feed" className = "no-underline flex items-center gap-1" >
140+ < Link href = { feedHref ( ) } className = "no-underline flex items-center gap-1" >
127141 < span className = "mono text-[9px] text-[var(--blue-l)] font-bold" > See all</ span >
128142 < ArrowRight size = { 10 } className = "text-[var(--blue-l)]" />
129143 </ Link >
130144 </ div >
131145 { recentEvents . map ( ( evt , i ) => {
132146 const sc = SEV_C [ evt . severity ] ?? 'var(--info)' ;
133147 return (
134- < Link key = { evt . id } href = { `/dashboard/feed?event= ${ evt . id } ` } className = "no-underline" >
148+ < Link key = { evt . id } href = { feedHref ( evt . id ) } className = "no-underline" >
135149 < div
136150 className = "flex gap-2.5 items-start safe-px py-2 hover:bg-[var(--bg-3)] transition-colors"
137151 style = { {
@@ -159,7 +173,7 @@ export function MobileOverview() {
159173 < div className = "border-t border-[var(--bd)] mt-0" >
160174 < div className = "flex items-center justify-between safe-px py-2 bg-[var(--bg-2)] border-b border-[var(--bd)]" >
161175 < span className = "section-title" > Active Stories</ span >
162- < Link href = "/dashboard/map" className = "no-underline flex items-center gap-1" >
176+ < Link href = { mapHref ( ) } className = "no-underline flex items-center gap-1" >
163177 < span className = "mono text-[9px] text-[var(--blue-l)] font-bold" > Map</ span >
164178 < ArrowRight size = { 10 } className = "text-[var(--blue-l)]" />
165179 </ Link >
@@ -171,7 +185,7 @@ export function MobileOverview() {
171185 } ;
172186 const c = catColor [ story . category ] ?? 'var(--t3)' ;
173187 return (
174- < Link key = { story . id } href = "/dashboard/map" className = "no-underline" >
188+ < Link key = { story . id } href = { mapHref ( story . id ) } className = "no-underline" >
175189 < div
176190 className = "flex gap-2.5 items-start safe-px py-2.5 hover:bg-[var(--bg-3)] transition-colors"
177191 style = { {
@@ -222,8 +236,9 @@ export function MobileOverview() {
222236 < div className = "border-t border-[var(--bd)] safe-px py-3" >
223237 < div className = "grid grid-cols-2 gap-2" >
224238 { [
225- { href : '/dashboard/actors' , label : 'ACTORS' , icon : Users , color : 'var(--teal)' } ,
239+ { href : actorsHref , label : 'ACTORS' , icon : Users , color : 'var(--teal)' } ,
226240 { href : '/dashboard/predictions' , label : 'PREDICTIONS' , icon : TrendingUp , color : 'var(--warning)' } ,
241+ { href : briefHref , label : 'BRIEF' , icon : BookOpen , color : 'var(--info)' } ,
227242 ] . map ( nav => (
228243 < Link key = { nav . href } href = { nav . href } className = "no-underline" >
229244 < div className = "flex items-center gap-2.5 px-3 py-3 border border-[var(--bd)] bg-[var(--bg-2)] hover:bg-[var(--bg-3)] transition-colors" >
0 commit comments