From fca99d6126c31fbb18ed9f1034cee6f940b040e8 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Tue, 10 Feb 2026 16:28:21 +0100 Subject: refactor --- apps/web/src/app/projects/page.tsx | 87 ++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 50 deletions(-) (limited to 'apps/web/src/app/projects/page.tsx') diff --git a/apps/web/src/app/projects/page.tsx b/apps/web/src/app/projects/page.tsx index 5d17a46c..492e0cbe 100644 --- a/apps/web/src/app/projects/page.tsx +++ b/apps/web/src/app/projects/page.tsx @@ -71,6 +71,11 @@ const formatProjectDuration = ({ return formatTimeCode({ timeInSeconds: duration, format }); }; +const VIEW_MODE_OPTIONS = [ + { mode: "grid" as const, icon: GridViewIcon, label: "Grid view" }, + { mode: "list" as const, icon: LeftToRightListDashIcon, label: "List view" }, +]; + export default function ProjectsPage() { const { searchQuery, sortKey, sortOrder, viewMode } = useProjectsStore(); const editor = useEditor(); @@ -147,34 +152,23 @@ function ProjectsHeader() { -
- - +
+ {VIEW_MODE_OPTIONS.map(({ mode, icon, label }) => ( + + ))}
@@ -277,28 +271,21 @@ function ProjectsToolbar({ projectIds }: { projectIds: string[] }) {
- - + {VIEW_MODE_OPTIONS.map(({ mode, icon, label }) => ( + + ))}
{selectedProjectCount > 0 ? : null} -- cgit v1.3.1