22 * Dashboard Page
33 *
44 * Protected dashboard page with modern shadcn/ui components and professional design.
5+ * Integrated with Zustand project store for state management.
56 */
67
78"use client" ;
@@ -13,9 +14,8 @@ import { useAuth } from '@/components/auth/AuthProvider';
1314import { BentoGrid } from '@/components/dashboard/bento-grid' ;
1415import { Button } from '@/components/ui/button' ;
1516import { Card , CardContent , CardDescription , CardHeader , CardTitle } from '@/components/ui/card' ;
16- import { Badge } from '@/components/ui/badge' ;
17- import { api } from '@/lib/api' ;
1817import { FolderIcon , CheckCircleIcon , ClockIcon , AlertCircleIcon , LogOutIcon } from 'lucide-react' ;
18+ import { api } from '@/lib/api' ;
1919import type { Project } from '../../../../shared/api-contract' ;
2020
2121function DashboardContent ( ) {
@@ -27,6 +27,8 @@ function DashboardContent() {
2727
2828 useEffect ( ( ) => {
2929 const fetchProjects = async ( ) => {
30+ if ( ! user ) return ;
31+
3032 try {
3133 setIsLoading ( true ) ;
3234 setError ( null ) ;
@@ -45,9 +47,7 @@ function DashboardContent() {
4547 }
4648 } ;
4749
48- if ( user ) {
49- fetchProjects ( ) ;
50- }
50+ fetchProjects ( ) ;
5151 } , [ user ] ) ;
5252
5353 const handleLogout = async ( ) => {
@@ -178,9 +178,14 @@ function DashboardContent() {
178178 { error && (
179179 < Card className = "border-destructive" >
180180 < CardContent className = "p-4" >
181- < div className = "flex items-center space-x-2" >
182- < AlertCircleIcon className = "h-4 w-4 text-destructive" />
183- < p className = "text-sm text-destructive" > { error } </ p >
181+ < div className = "flex items-center justify-between" >
182+ < div className = "flex items-center space-x-2" >
183+ < AlertCircleIcon className = "h-4 w-4 text-destructive" />
184+ < p className = "text-sm text-destructive" > { error } </ p >
185+ </ div >
186+ < Button variant = "outline" size = "sm" onClick = { ( ) => setError ( null ) } >
187+ Dismiss
188+ </ Button >
184189 </ div >
185190 </ CardContent >
186191 </ Card >
0 commit comments