@@ -76,11 +76,13 @@ import { PageHeader } from "../components/ui";
7676*/
7777
7878export default function HomePage ( ) {
79- const { profile } = useAuth ( ) ;
79+ const { profile } = useAuth ( ) ;
8080 const [ recommendedTenders , setRecommendedTenders ] = useState <
8181 TenderSearchResult [ ]
8282 > ( [ ] ) ;
83- const [ dashboardData , setDashboardData ] = useState < DashboardData | null > ( null ) ;
83+ const [ dashboardData , setDashboardData ] = useState < DashboardData | null > (
84+ null
85+ ) ;
8486 const [ activities , setActivities ] = useState < Activity [ ] > ( [ ] ) ;
8587 const [ loading , setLoading ] = useState ( true ) ;
8688 const [ error , setError ] = useState < string | null > ( null ) ;
@@ -106,15 +108,17 @@ export default function HomePage() {
106108
107109 // Track page view
108110 await analyticsAPI . trackActivity ( {
109- actionType : ' page_view' ,
110- resourceType : ' dashboard' ,
111- pageUrl : ' /home' ,
111+ actionType : " page_view" ,
112+ resourceType : " dashboard" ,
113+ pageUrl : " /home" ,
112114 sessionId : Date . now ( ) . toString ( ) ,
113115 } ) ;
114116 } catch ( err ) {
115117 console . error ( "Failed to fetch dashboard data:" , err ) ;
116- setError ( err instanceof Error ? err . message : 'Failed to load dashboard data' ) ;
117-
118+ setError (
119+ err instanceof Error ? err . message : "Failed to load dashboard data"
120+ ) ;
121+
118122 // Load user activities
119123 let activities : Activity [ ] = [ ] ;
120124 try {
@@ -175,7 +179,9 @@ export default function HomePage() {
175179 < div className = "h-full flex flex-col items-center justify-center space-y-4" >
176180 < div className = "text-center" >
177181 < HouseIcon className = "w-16 h-16 text-gray-400 mx-auto mb-4" />
178- < h2 className = "text-xl font-semibold text-text mb-2" > Dashboard Unavailable</ h2 >
182+ < h2 className = "text-xl font-semibold text-text mb-2" >
183+ Dashboard Unavailable
184+ </ h2 >
179185 < p className = "text-error text-sm mb-4" > { error } </ p >
180186 < button
181187 onClick = { ( ) => window . location . reload ( ) }
@@ -195,16 +201,19 @@ export default function HomePage() {
195201 < PageHeader
196202 icon = { < HouseIcon className = "w-10 h-10 text-primary" /> }
197203 title = "Dashboard"
198- description = { `Welcome back, ${ profile ?. company_name || ' User' } ` }
204+ description = { `Welcome back, ${ profile ?. company_name || " User" } ` }
199205 />
200-
206+
201207 { /* Stats Grid */ }
202208 { dashboardData ? (
203209 < DashboardStatsGrid data = { dashboardData } loading = { loading } />
204210 ) : (
205211 < div className = "grid grid-cols-2 lg:grid-cols-6 gap-4" >
206212 { Array . from ( { length : 6 } ) . map ( ( _ , index ) => (
207- < div key = { index } className = "bg-surface border border-border rounded-lg p-4 animate-pulse" >
213+ < div
214+ key = { index }
215+ className = "bg-surface border border-border rounded-lg p-4 animate-pulse"
216+ >
208217 < div className = "h-8 w-8 bg-gray-300 rounded-lg mb-3" > </ div >
209218 < div className = "h-6 bg-gray-300 rounded mb-2" > </ div >
210219 < div className = "h-4 bg-gray-300 rounded w-3/4" > </ div >
@@ -214,13 +223,6 @@ export default function HomePage() {
214223 ) }
215224 </ div >
216225
217- { /* Quick Actions */ }
218- < QuickActions
219- newTodayCount = { dashboardData ?. tenderStats . newToday }
220- bookmarkedCount = { dashboardData ?. tenderStats . bookmarked }
221- urgentDeadlines = { dashboardData ?. tenderStats . expiringSoon }
222- />
223-
224226 { /* Main Dashboard Content */ }
225227 < div className = "grid grid-cols-1 lg:grid-cols-3 gap-6 flex-1" >
226228 { /* ROI Calculator - Takes 2 columns on large screens */ }
0 commit comments