@@ -7,7 +7,6 @@ import { useAuthorization } from '@/hooks/useAuthorization';
77import { ROLES } from '@/constants/roles' ;
88import { ISwepBanner } from '@/types/swep-banners/ISwepBanner' ;
99import { authenticatedFetch } from '@/utils/authenticatedFetch' ;
10- import { formatSwepActivePeriod , parseSwepBody } from '@/utils/swep' ;
1110import { ErrorState } from '@/components/ui/ErrorState' ;
1211import { errorToast } from '@/utils/toast' ;
1312import { LoadingSpinner } from '@/components/ui/LoadingSpinner' ;
@@ -91,30 +90,40 @@ export default function SwepViewPage() {
9190 ) ;
9291 }
9392
94- const activePeriodText = formatSwepActivePeriod ( swepData ) ;
95- const parsedBody = parseSwepBody ( swepData . Body ) ;
96-
9793 return (
9894 < >
9995 { /* SWEP Header Section - Full width matching public website */ }
100- < div className = "bg-red-50 border-b-4 border-brand-g py-12" >
101- < div className = "max-w-6xl mx-auto px-6" >
102- < div className = "flex items-center gap-3 mb-4" >
103- < div className = "w-6 h-6 bg-brand-g rounded-full flex items-center justify-center flex-shrink-0" >
104- < div className = "w-3 h-3 bg-white rounded-full" > </ div >
96+ { ! swepData . IsActive && (
97+ < div className = "bg-brand-d py-12" >
98+ < div className = "max-w-6xl mx-auto px-6 text-center" >
99+ < h2 className = "text-2xl font-bold text-brand-l mb-4" >
100+ Severe Weather Emergency Accommodation is not currently active in { swepData . LocationName }
101+ </ h2 >
102+ < p className = "text-brand-k mb-4" >
103+ This page provides information about emergency accommodation during severe weather. The service is activated when temperatures drop below freezing.
104+ </ p >
105+ < p className = "text-brand-k mb-6" > If you need help right now, please visit:</ p >
106+ < div className = "flex flex-col sm:flex-row gap-4 justify-center" >
107+ < a
108+ href = { `${ process . env . NEXT_PUBLIC_WEB_URL } /${ swepData . LocationSlug } /advice/` }
109+ className = "inline-flex items-center justify-center px-6 py-3 bg-brand-g text-white font-semibold rounded-md hover:bg-opacity-90 transition-colors"
110+ target = "_blank"
111+ rel = "noopener noreferrer"
112+ >
113+ See emergency advice
114+ </ a >
115+ < a
116+ href = { `${ process . env . NEXT_PUBLIC_WEB_URL } /find-help/` }
117+ className = "inline-flex items-center justify-center px-6 py-3 bg-brand-e text-brand-l font-semibold rounded-md hover:bg-opacity-90 transition-colors"
118+ target = "_blank"
119+ rel = "noopener noreferrer"
120+ >
121+ Find Help
122+ </ a >
105123 </ div >
106- < h1 className = "text-3xl font-bold text-red-800 mb-0" >
107- { swepData . Title }
108- </ h1 >
109- </ div >
110- < p className = "text-lg text-red-700 mb-4" >
111- { activePeriodText }
112- </ p >
113- < div className = "bg-brand-g text-white px-4 py-2 rounded-md inline-block" >
114- < strong > Emergency Support Available</ strong >
115124 </ div >
116125 </ div >
117- </ div >
126+ ) }
118127
119128 { /* Content Section - matching public website */ }
120129 < section className = "py-12" >
@@ -133,7 +142,7 @@ export default function SwepViewPage() {
133142 { /* Body content with prose styling */ }
134143 < div
135144 className = "prose prose-lg max-w-none mb-12"
136- dangerouslySetInnerHTML = { { __html : parsedBody } }
145+ dangerouslySetInnerHTML = { { __html : swepData . Body } }
137146 />
138147
139148 { /* Emergency Contacts Section */ }
0 commit comments