import { useState, useCallback } from 'react' import { Sparkles, ArrowRight } from 'lucide-react' import { networkDiagramsApi } from '@/api' import type { AIGenerateResponse } from '@/types' const EXAMPLE_PROMPTS = [ 'Small office with firewall and core switch', 'Azure hybrid cloud with VPN gateway', 'Branch office connected to HQ via MPLS', 'Data center with redundant core switches', 'Remote workforce with Meraki and cloud apps', ] interface CanvasEmptyPromptProps { onGenerate: (result: AIGenerateResponse, mode: 'replace' | 'merge') => void } export function CanvasEmptyPrompt({ onGenerate }: CanvasEmptyPromptProps) { const [description, setDescription] = useState('') const [loading, setLoading] = useState(false) const [error, setError] = useState(null) const handleGenerate = useCallback(async (text?: string) => { const desc = (text ?? description).trim() if (!desc) return setLoading(true) setError(null) try { const result = await networkDiagramsApi.aiGenerate({ description: desc, mode: 'replace', existingBounds: null, }) onGenerate(result, 'replace') } catch (err: unknown) { setError(err instanceof Error ? err.message : 'Generation failed. Please try again.') } finally { setLoading(false) } }, [description, onGenerate]) return (

Describe your network

AI will generate the topology in seconds — or drag devices from the left panel to build manually.