diff --git a/app/dashboard/loading.tsx b/app/dashboard/loading.tsx deleted file mode 100644 index f15322a..0000000 --- a/app/dashboard/loading.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function Loading() { - return null -} diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index 63fc0a8..f5aff34 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -6,6 +6,8 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" +import { Skeleton } from "@/components/ui/skeleton" +import { MessageSquare } from "lucide-react" import { Folder, Search, @@ -35,8 +37,61 @@ const formatBytes = (bytes: number, decimals = 2) => { type FolderType = 'contrat' | 'projet' | 'rapport' | 'finance' | 'rh' | 'marketing' | 'autre'; +function DashboardLoadingSkeleton() { + return ( +
+ {/* Colonne 1: Squelette Liste */} +
+
+
+ + +
+
+ +
+
+
+
+ {[...Array(8)].map((_, i) => ( + + +
+ +
+ +
+
+
+
+ ))} +
+
+
+ + {/* Colonne 2: Squelette Résumé */} +
+
+

Chargement des données...

+
+
+ + {/* Colonne 3: Squelette Chat */} +
+
+
+ +

+ Chargement du chat... +

+
+
+
+
+ ) +} + export default function DashboardPage() { - const router = useRouter() const [searchTerm, setSearchTerm] = useState("") const [folderType, setFolderType] = useState(null); const [isModalOpen, setIsModalOpen] = useState(false); @@ -111,6 +166,10 @@ export default function DashboardPage() { [isConnected, userPairingId, setFolderProcesses, setMyFolderProcesses, setFolderPrivateData] ); + if (loadingFolders) { + return ; + } + return (
@@ -153,8 +212,8 @@ export default function DashboardPage() { setSelectedFolder(folder)} > @@ -265,8 +324,8 @@ export default function DashboardPage() { {notification && (
{notification.message}