import type { LucideIcon } from 'lucide-react'; import { Card, CardContent } from './ui/card'; import { Button } from './ui/button'; import { Alert, AlertDescription } from './ui/alert'; import { Badge } from './ui/badge'; import { Textarea } from './ui/textarea'; import { Loader2, CheckCircle, AlertCircle, Play, RotateCw } from 'lucide-react'; import { useCentralStatus } from '../hooks/useCentralStatus'; interface MetadataItem { label: string; value: string | number | undefined; } interface SubsystemPageProps { title: string; description: string; icon: LucideIcon; daemonKey: string; configContent?: string; isLoadingConfig?: boolean; rawStatusLabel?: string; rawStatusContent?: string; onGenerate?: () => void; isGenerating?: boolean; generateLabel?: string; onRestart?: () => void; isRestarting?: boolean; restartLabel?: string; successMessage?: string | null; errorMessage?: string | null; metadata?: MetadataItem[]; } export function SubsystemPage({ title, description, icon: Icon, daemonKey, configContent, isLoadingConfig, rawStatusLabel, rawStatusContent, onGenerate, isGenerating, generateLabel = 'Generate & Apply', onRestart, isRestarting, restartLabel = 'Restart', successMessage, errorMessage, metadata, }: SubsystemPageProps) { const { data: centralStatus } = useCentralStatus(); const active = centralStatus?.daemons?.[daemonKey]?.active; return (
{description}
Loading configuration...
{rawStatusContent}