import Link from 'next/link'; import { Package, Server, Users, CheckCircle, Clock, SkipForward } from 'lucide-react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { listClusters } from '@/lib/actions/clusters'; import { listCustomers, listCustomersByCluster } from '@/lib/actions/customers'; import { getActiveReleases, getReleaseStats } from '@/lib/actions/releases'; export default async function DashboardPage() { const [clusters, customersList, activeReleases, stats] = await Promise.all([ listClusters(), listCustomers(), getActiveReleases(), getReleaseStats(), ]); // Get customer counts per cluster const clustersWithCount = await Promise.all( clusters.map(async (cluster) => { const customers = await listCustomersByCluster(cluster.id); return { ...cluster, customerCount: customers.length, }; }) ); return (
{/* Header */}

Dashboard

Overview of your release orchestration system

{/* Stats Cards */}
Active Releases
{stats.activeReleases}

of {stats.totalReleases} total

Pending Steps
{stats.pendingSteps}

awaiting completion

Completed Steps
{stats.doneSteps}

successfully done

Total Customers
{customersList.length}

across {clusters.length} clusters

{/* Active Releases */} Active Releases {activeReleases.length === 0 ? (

No active releases.

) : (
{activeReleases.slice(0, 5).map((release) => (

{release.name}

{release.type}
{release.versionNumber && (

{release.versionNumber}

)}
))}
)}
{/* Clusters Overview */} Clusters {clustersWithCount.length === 0 ? (

No clusters configured.

) : (
{clustersWithCount.map((cluster) => (
{cluster.name}
{cluster.customerCount} ))}
)}
{/* Quick Actions */}

Create Release

Start a new deployment cycle

Add Cluster

Register a new K8s cluster

Add Customer

Onboard a new customer

); }