From 4527571d5ff73c9595275e6fd80b7126a20a0969 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Sun, 12 Apr 2026 05:26:37 +0000 Subject: [PATCH] feat: add manual create option for network maps --- .../components/network/CanvasEmptyPrompt.tsx | 194 ++++++++++++------ 1 file changed, 136 insertions(+), 58 deletions(-) diff --git a/frontend/src/components/network/CanvasEmptyPrompt.tsx b/frontend/src/components/network/CanvasEmptyPrompt.tsx index ad23f6cf..e1cec86d 100644 --- a/frontend/src/components/network/CanvasEmptyPrompt.tsx +++ b/frontend/src/components/network/CanvasEmptyPrompt.tsx @@ -1,5 +1,5 @@ import { useState, useCallback } from 'react' -import { Sparkles, ArrowRight } from 'lucide-react' +import { Sparkles, ArrowRight, PencilRuler, Wand2 } from 'lucide-react' import { networkDiagramsApi } from '@/api' import type { AIGenerateResponse } from '@/types' @@ -16,6 +16,7 @@ interface CanvasEmptyPromptProps { } export function CanvasEmptyPrompt({ onGenerate }: CanvasEmptyPromptProps) { + const [mode, setMode] = useState<'choice' | 'ai' | 'manual'>('choice') const [description, setDescription] = useState('') const [loading, setLoading] = useState(false) const [error, setError] = useState(null) @@ -39,69 +40,146 @@ export function CanvasEmptyPrompt({ onGenerate }: CanvasEmptyPromptProps) { } }, [description, onGenerate]) + if (mode === 'manual') { + return ( +
+
+ + Manual mode enabled. Drag devices from the left panel to start building. + + +
+
+ ) + } + return (
-
-
- -

- Describe your network -

-
-

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

-
+ {mode === 'choice' ? ( + <> +
+
+ +

+ Start a network map +

+
+

+ Generate a topology with AI or start with a blank canvas and build it manually. +

+
-
-