33import { useState } from 'react' ;
44import HouseholdCalculator from '@/components/HouseholdCalculator' ;
55import PolicyOverview from '@/components/PolicyOverview' ;
6+ import AggregateImpact from '@/components/AggregateImpact' ;
67
78export default function Home ( ) {
8- const [ activeTab , setActiveTab ] = useState < 'policy' | 'calculator' > ( 'policy' ) ;
9+ const [ activeTab , setActiveTab ] = useState < 'policy' | 'calculator' | 'statewide' > ( 'policy' ) ;
910
1011 const TAB_CONFIG = [
1112 { id : 'policy' as const , label : 'How it works' } ,
1213 { id : 'calculator' as const , label : 'Household calculator' } ,
14+ { id : 'statewide' as const , label : 'Statewide impact' } ,
1315 ] ;
1416
1517 return (
@@ -28,15 +30,15 @@ export default function Home() {
2830
2931 < div className = "max-w-5xl mx-auto px-4 py-8" >
3032 { /* Tabs */ }
31- < div className = "flex space-x-1 mb-4" role = "tablist" >
33+ < div className = "flex space-x-1 mb-4 overflow-x-auto " role = "tablist" >
3234 { TAB_CONFIG . map ( ( tab ) => (
3335 < button
3436 key = { tab . id }
3537 role = "tab"
3638 aria-selected = { activeTab === tab . id }
3739 aria-controls = { `tabpanel-${ tab . id } ` }
3840 onClick = { ( ) => setActiveTab ( tab . id ) }
39- className = { `px-6 py-3 rounded-t-lg font-semibold transition-colors ${
41+ className = { `px-6 py-3 rounded-t-lg font-semibold transition-colors whitespace-nowrap ${
4042 activeTab === tab . id
4143 ? 'bg-white text-primary-600 border-t-4 border-primary-500'
4244 : 'bg-gray-200 text-gray-700 hover:bg-gray-300'
@@ -53,11 +55,9 @@ export default function Home() {
5355 id = { `tabpanel-${ activeTab } ` }
5456 className = "bg-white rounded-lg shadow-md p-6"
5557 >
56- { activeTab === 'policy' ? (
57- < PolicyOverview />
58- ) : (
59- < HouseholdCalculator />
60- ) }
58+ { activeTab === 'policy' && < PolicyOverview /> }
59+ { activeTab === 'calculator' && < HouseholdCalculator /> }
60+ { activeTab === 'statewide' && < AggregateImpact /> }
6161 </ div >
6262 </ div >
6363 </ main >
0 commit comments