Skip to content

Commit b58034b

Browse files
authored
Merge pull request #37 from SmartQueryy/task-a14
Task a14
2 parents 3e6a9d0 + 32dfc7b commit b58034b

9 files changed

Lines changed: 1012 additions & 9 deletions

File tree

frontend/src/app/dashboard/page.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
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';
1314
import { BentoGrid } from '@/components/dashboard/bento-grid';
1415
import { Button } from '@/components/ui/button';
1516
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
16-
import { Badge } from '@/components/ui/badge';
17-
import { api } from '@/lib/api';
1817
import { FolderIcon, CheckCircleIcon, ClockIcon, AlertCircleIcon, LogOutIcon } from 'lucide-react';
18+
import { api } from '@/lib/api';
1919
import type { Project } from '../../../../shared/api-contract';
2020

2121
function 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>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use client';
2+
3+
import React from 'react';
4+
import { useProjectActions } from '@/lib/store/project';
5+
6+
export default function TestActionsPage() {
7+
const actions = useProjectActions();
8+
9+
console.log('TestActionsPage render', {
10+
hasActions: !!actions,
11+
actionKeys: Object.keys(actions)
12+
});
13+
14+
return (
15+
<div className="p-8">
16+
<h1 className="text-2xl font-bold mb-4">Test Actions Page</h1>
17+
<div>
18+
<p>Actions available: {Object.keys(actions).join(', ')}</p>
19+
</div>
20+
</div>
21+
);
22+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
'use client';
2+
3+
import React from 'react';
4+
import { useProjects } from '@/lib/store/project';
5+
6+
export default function TestDashboardSimplePage() {
7+
const { projects, isLoading, error } = useProjects();
8+
9+
console.log('Render TestDashboardSimplePage', { projects: projects.length, isLoading, error });
10+
11+
return (
12+
<div className="p-8">
13+
<h1 className="text-2xl font-bold mb-4">Simple Test Dashboard</h1>
14+
<div>
15+
<p>Projects: {projects.length}</p>
16+
<p>Loading: {isLoading ? 'Yes' : 'No'}</p>
17+
<p>Error: {error || 'None'}</p>
18+
</div>
19+
</div>
20+
);
21+
}

0 commit comments

Comments
 (0)