Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions frontend/src/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Dashboard Page
*
* Protected dashboard page with modern shadcn/ui components and professional design.
* Integrated with Zustand project store for state management.
*/

"use client";
Expand All @@ -13,9 +14,8 @@ import { useAuth } from '@/components/auth/AuthProvider';
import { BentoGrid } from '@/components/dashboard/bento-grid';
import { Button } from '@/components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { api } from '@/lib/api';
import { FolderIcon, CheckCircleIcon, ClockIcon, AlertCircleIcon, LogOutIcon } from 'lucide-react';
import { api } from '@/lib/api';
import type { Project } from '../../../../shared/api-contract';

function DashboardContent() {
Expand All @@ -27,6 +27,8 @@ function DashboardContent() {

useEffect(() => {
const fetchProjects = async () => {
if (!user) return;

try {
setIsLoading(true);
setError(null);
Expand All @@ -45,9 +47,7 @@ function DashboardContent() {
}
};

if (user) {
fetchProjects();
}
fetchProjects();
}, [user]);

const handleLogout = async () => {
Expand Down Expand Up @@ -178,9 +178,14 @@ function DashboardContent() {
{error && (
<Card className="border-destructive">
<CardContent className="p-4">
<div className="flex items-center space-x-2">
<AlertCircleIcon className="h-4 w-4 text-destructive" />
<p className="text-sm text-destructive">{error}</p>
<div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<AlertCircleIcon className="h-4 w-4 text-destructive" />
<p className="text-sm text-destructive">{error}</p>
</div>
<Button variant="outline" size="sm" onClick={() => setError(null)}>
Dismiss
</Button>
</div>
</CardContent>
</Card>
Expand Down
22 changes: 22 additions & 0 deletions frontend/src/app/test-actions/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use client';

import React from 'react';
import { useProjectActions } from '@/lib/store/project';

export default function TestActionsPage() {
const actions = useProjectActions();

console.log('TestActionsPage render', {
hasActions: !!actions,
actionKeys: Object.keys(actions)
});

return (
<div className="p-8">
<h1 className="text-2xl font-bold mb-4">Test Actions Page</h1>
<div>
<p>Actions available: {Object.keys(actions).join(', ')}</p>
</div>
</div>
);
}
21 changes: 21 additions & 0 deletions frontend/src/app/test-dashboard-simple/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use client';

import React from 'react';
import { useProjects } from '@/lib/store/project';

export default function TestDashboardSimplePage() {
const { projects, isLoading, error } = useProjects();

console.log('Render TestDashboardSimplePage', { projects: projects.length, isLoading, error });

return (
<div className="p-8">
<h1 className="text-2xl font-bold mb-4">Simple Test Dashboard</h1>
<div>
<p>Projects: {projects.length}</p>
<p>Loading: {isLoading ? 'Yes' : 'No'}</p>
<p>Error: {error || 'None'}</p>
</div>
</div>
);
}
Loading
Loading