From f9c0b71c4d4f702a82d98c8bc7abe61cf16203c7 Mon Sep 17 00:00:00 2001 From: admin-valentin Date: Sat, 1 Aug 2026 09:57:57 +0000 Subject: [PATCH] feat(cc-050): Workspace Settings page --- .../dashboard/settings/workspaces/page.tsx | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/app/dashboard/settings/workspaces/page.tsx diff --git a/src/app/dashboard/settings/workspaces/page.tsx b/src/app/dashboard/settings/workspaces/page.tsx new file mode 100644 index 0000000..7467cd6 --- /dev/null +++ b/src/app/dashboard/settings/workspaces/page.tsx @@ -0,0 +1,64 @@ +'use client'; + +import { useQuery } from '@tanstack/react-query'; +import { apiFetch } from '../../../../lib/api'; +import type { TenantMembership } from '../../../../lib/api'; +import { useSession } from '../../../../components/session-provider'; + +export default function WorkspacesPage() { + const { activeTenant } = useSession(); + const tenantId = activeTenant?.tenantId ?? ''; + + const { data: me, isLoading } = useQuery({ + queryKey: ['me-workspaces'], + queryFn: () => apiFetch<{ userId: string; tenants: TenantMembership[] }>('/v1/me', { tenantId }), + staleTime: 60_000, + }); + + const tenantList = me?.tenants ?? []; + + return ( +
+
+

Workspace-uri

+

+ Toate workspace-urile la care ai acces ({tenantList.length}). +

+
+ + {isLoading ? ( +

Se încarcă…

+ ) : tenantList.length === 0 ? ( +
+

Niciun workspace găsit.

+
+ ) : ( + + )} +
+ ); +}