From b1238b7bb8839531fada94811f05388df31388cb Mon Sep 17 00:00:00 2001 From: Flexomatic81 Date: Mon, 23 Feb 2026 20:32:40 +0100 Subject: [PATCH] refactor: move integrations overview from main nav into admin area Remove the top-level "Integrationen" sidebar entry and add an "Uebersicht" tab to the admin integrations page with summary stats and integration cards. Co-Authored-By: Claude Opus 4.6 --- .../admin-integrations-content.tsx | 89 ++++++++++++++++++- apps/web/src/components/layout/sidebar.tsx | 25 ------ 2 files changed, 86 insertions(+), 28 deletions(-) diff --git a/apps/web/src/app/[locale]/(auth)/admin/integrations/admin-integrations-content.tsx b/apps/web/src/app/[locale]/(auth)/admin/integrations/admin-integrations-content.tsx index b3daad3..3943ea6 100644 --- a/apps/web/src/app/[locale]/(auth)/admin/integrations/admin-integrations-content.tsx +++ b/apps/web/src/app/[locale]/(auth)/admin/integrations/admin-integrations-content.tsx @@ -16,6 +16,10 @@ import { Eye, EyeOff, Loader2, + Plug, + CheckCircle2, + AlertCircle, + LayoutGrid, type LucideIcon, } from 'lucide-react'; @@ -41,7 +45,7 @@ import { } from '@/components/ui/select'; import { Skeleton } from '@/components/ui/skeleton'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; -import { IntegrationStatusBadge } from '@/components/integrations'; +import { IntegrationStatusBadge, IntegrationCard } from '@/components/integrations'; import { useAllIntegrationStatuses } from '@/hooks/integrations'; import { useCredentials, @@ -459,11 +463,14 @@ function IntegrationPanel({ integrationType }: IntegrationPanelProps) { * Lists each integration as a tab; each tab loads its own credential * state so queries are isolated and only triggered when the tab is visited. */ -export function AdminIntegrationsContent({ locale: _locale }: AdminIntegrationsContentProps) { +export function AdminIntegrationsContent({ locale }: AdminIntegrationsContentProps) { const t = useTranslations('integrations'); const tAdmin = useTranslations('admin'); const { data: integrations, isLoading } = useAllIntegrationStatuses(); + const connectedCount = integrations?.filter((i) => i.status === 'connected').length ?? 0; + const errorCount = integrations?.filter((i) => i.status === 'error').length ?? 0; + return (
{/* Header */} @@ -501,8 +508,12 @@ export function AdminIntegrationsContent({ locale: _locale }: AdminIntegrationsC ))}
) : ( - + + + + {t('overview')} + {integrations?.map((config) => { const meta = integrationMeta[config.type]; const Icon = meta.icon; @@ -515,6 +526,78 @@ export function AdminIntegrationsContent({ locale: _locale }: AdminIntegrationsC })} + {/* Overview tab */} + + + {/* Summary Stats */} +
+ + + {t('allIntegrations')} + + + +
{integrations?.length ?? 0}
+
+
+ + + + {t('connected')} + + + +
{connectedCount}
+
+
+ + + + {t('error')} + + + +
0 && 'text-destructive')}> + {errorCount} +
+
+
+
+ + {/* Integration Cards Grid */} + + {integrations?.map((config) => ( + + + + ))} + +
+
+ + {/* Individual integration tabs */} {integrations?.map((config) => (