import Link from 'next/link'; import { notFound } from 'next/navigation'; import { ArrowLeft, Server, Users } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { getClusterWithCustomers } from '@/lib/actions/clusters'; interface ClusterDetailPageProps { params: Promise<{ id: string; }>; } export default async function ClusterDetailPage({ params }: ClusterDetailPageProps) { const { id } = await params; const cluster = await getClusterWithCustomers(parseInt(id)); if (!cluster) { notFound(); } return (

{cluster.name}

Cluster Details

Cluster Information {cluster.kubeconfigPath && (

{cluster.kubeconfigPath}

)} {cluster.description && (

{cluster.description}

)}

{cluster.createdAt ? new Date(cluster.createdAt).toLocaleString() : 'N/A'}

Customers ({cluster.customers.length}) {cluster.customers.length === 0 ? (

No customers in this cluster yet.

) : (
    {cluster.customers.map((customer) => (
  • {customer.name}

    {customer.namespace}

  • ))}
)}
); }