@@ -24,11 +24,16 @@ import type { DecisionReportResponse } from "@/types/api";
2424
2525export function AcceptedSchoolsWorkspace ( ) {
2626 const { savedSchools, updateSavedStatus } = useSchoolActionState ( ) ;
27+ const [ localStateReady , setLocalStateReady ] = useState ( false ) ;
2728 const candidates = useMemo ( ( ) => getDecisionCandidates ( getVisibleSavedSchools ( savedSchools ) ) , [ savedSchools ] ) ;
2829 const [ offers , setOffers ] = useState < DecisionOfferDraft [ ] > ( [ ] ) ;
2930 const [ report , setReport ] = useState < DecisionReportResponse | null > ( null ) ;
3031 const [ saveState , setSaveState ] = useState < string > ( "Local" ) ;
3132
33+ useEffect ( ( ) => {
34+ setLocalStateReady ( true ) ;
35+ } , [ ] ) ;
36+
3237 useEffect ( ( ) => {
3338 setOffers ( ( current ) => mergeOffersWithCandidates ( candidates , current . length ? current : readDecisionOffers ( ) ) ) ;
3439 } , [ candidates ] ) ;
@@ -97,13 +102,15 @@ export function AcceptedSchoolsWorkspace() {
97102 </ div >
98103 </ header >
99104
100- { candidates . length === 0 ? (
105+ { localStateReady && candidates . length === 0 ? (
101106 < EmptyState
102- title = "No accepted schools yet"
107+ title = "No admitted schools yet"
103108 description = "Mark saved schools as accepted or finalist to start the decision workspace."
104109 action = { < Link href = "/dashboard" > Review saved schools</ Link > }
105110 />
106- ) : (
111+ ) : null }
112+
113+ { candidates . length > 0 ? (
107114 < div className = "grid gap-6 xl:grid-cols-[minmax(0,1.35fr)_minmax(360px,0.65fr)]" >
108115 < section className = "space-y-4" >
109116 { candidates . map ( ( school ) => {
@@ -121,7 +128,7 @@ export function AcceptedSchoolsWorkspace() {
121128 </ section >
122129 < DecisionSummaryPanel report = { report } />
123130 </ div >
124- ) }
131+ ) : null }
125132 </ main >
126133 ) ;
127134}
0 commit comments