'use client' import { useState, useEffect } from 'react' import { ChevronRightIcon, CheckCircleIcon } from '@heroicons/react/24/outline' import SystemDetection from './components/SystemDetection' import NetworkConfiguration from './components/NetworkConfiguration' import SecuritySetup from './components/SecuritySetup' import AIConfiguration from './components/AIConfiguration' import ResourceAllocation from './components/ResourceAllocation' import ServiceDeployment from './components/ServiceDeployment' import ClusterFormation from './components/ClusterFormation' import TestingValidation from './components/TestingValidation' const SETUP_STEPS = [ { id: 'detection', title: 'System Detection', description: 'Detect hardware and validate installation', component: SystemDetection, }, { id: 'network', title: 'Network Configuration', description: 'Configure network and firewall settings', component: NetworkConfiguration, }, { id: 'security', title: 'Security Setup', description: 'Configure authentication and SSH access', component: SecuritySetup, }, { id: 'ai', title: 'AI Integration', description: 'Configure OpenAI and Ollama/Parallama', component: AIConfiguration, }, { id: 'resources', title: 'Resource Allocation', description: 'Allocate CPU, memory, and storage', component: ResourceAllocation, }, { id: 'deployment', title: 'Service Deployment', description: 'Deploy and configure BZZZ services', component: ServiceDeployment, }, { id: 'cluster', title: 'Cluster Formation', description: 'Join or create BZZZ cluster', component: ClusterFormation, }, { id: 'testing', title: 'Testing & Validation', description: 'Validate configuration and test connectivity', component: TestingValidation, }, ] interface ConfigData { [key: string]: any } export default function SetupPage() { const [currentStep, setCurrentStep] = useState(0) const [completedSteps, setCompletedSteps] = useState(new Set()) const [configData, setConfigData] = useState({}) const [systemInfo, setSystemInfo] = useState(null) // Load system information on mount useEffect(() => { fetchSystemInfo() }, []) const fetchSystemInfo = async () => { try { const response = await fetch('/api/system/info') if (response.ok) { const info = await response.json() setSystemInfo(info) } } catch (error) { console.error('Failed to fetch system info:', error) } } const handleStepComplete = (stepIndex: number, data: any) => { setCompletedSteps(prev => new Set([...prev, stepIndex])) setConfigData(prev => ({ ...prev, ...data })) // Auto-advance to next step if (stepIndex < SETUP_STEPS.length - 1) { setCurrentStep(stepIndex + 1) } } const handleStepBack = () => { if (currentStep > 0) { setCurrentStep(currentStep - 1) } } const CurrentStepComponent = SETUP_STEPS[currentStep].component return (

Welcome to BZZZ Setup

Let's configure your distributed AI coordination cluster in {SETUP_STEPS.length} simple steps.

{/* Progress Sidebar */}

Setup Progress

Progress: {completedSteps.size} of {SETUP_STEPS.length} steps
{/* Main Content */}

{SETUP_STEPS[currentStep].title}

Step {currentStep + 1} of {SETUP_STEPS.length}

{SETUP_STEPS[currentStep].description}

handleStepComplete(currentStep, data)} onBack={currentStep > 0 ? handleStepBack : undefined} isCompleted={completedSteps.has(currentStep)} />
) }