diff --git a/app/Dashboard/page.tsx b/app/Dashboard/page.tsx index 0b7adb5..b1f2325 100644 --- a/app/Dashboard/page.tsx +++ b/app/Dashboard/page.tsx @@ -15,26 +15,23 @@ export default function Dashboard() { setProjects(storedProjects); }, []); - // 5. Sorting logic now uses the state variable const sortedProjects = [...projects].sort((a, b) => { - const dateA = new Date(a.id).getTime(); // Use 'id' (timestamp) for sorting + const dateA = new Date(a.id).getTime(); const dateB = new Date(b.id).getTime(); if (sortOrder === "newest") { - return dateB - dateA; // Newest first + return dateB - dateA; } else { - return dateA - dateB; // Oldest first + return dateA - dateB; } }); - // 6. Filter the sorted projects const filtered = sortedProjects.filter((p) => p.title.toLowerCase().includes(query.toLowerCase()) ); - // 7. Fix the "Create" button link const handleCreateClick = () => { - window.location.href = "/formfile"; // Changed from "/dashbaord/create" + window.location.href = "/formfile"; }; const toggleSortOrder = () => { @@ -77,6 +74,12 @@ export default function Dashboard() { > Settings

+ + Logout + @@ -106,25 +109,27 @@ export default function Dashboard() {
-

- Project Names -

- +
+

+ Project Names +

+ +