diff --git a/index.html b/index.html index f171789..07d6596 100644 --- a/index.html +++ b/index.html @@ -4,9 +4,9 @@ - Docker Build Debugger + DevTools Hub - + diff --git a/src/App.tsx b/src/App.tsx index a89252e..527ccba 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,52 +1,23 @@ import { useState } from 'react' import { useKV } from '@github/spark/hooks' -import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' import { Button } from '@/components/ui/button' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' -import { Textarea } from '@/components/ui/textarea' -import { Badge } from '@/components/ui/badge' -import { ScrollArea } from '@/components/ui/scroll-area' -import { Separator } from '@/components/ui/separator' -import { Alert, AlertDescription } from '@/components/ui/alert' -import { Terminal, Warning, CheckCircle, Copy, Code, Stack, MagnifyingGlass, Sparkle } from '@phosphor-icons/react' -import { parseDockerLog, getSolutionsForError, knowledgeBase } from '@/lib/docker-parser' -import { DockerError, KnowledgeBaseItem } from '@/types/docker' -import { toast } from 'sonner' -import { motion, AnimatePresence } from 'framer-motion' +import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet' +import { List, Stack, House, Wrench } from '@phosphor-icons/react' +import { DockerBuildDebugger } from '@/components/DockerBuildDebugger' +import { motion } from 'framer-motion' + +type View = 'home' | 'docker-debugger' function App() { - const [logInput, setLogInput] = useKV('docker-log-input', '') - const [parsedErrors, setParsedErrors] = useState([]) - const [selectedKbItem, setSelectedKbItem] = useState(null) - const [searchQuery, setSearchQuery] = useState('') + const [currentView, setCurrentView] = useKV('current-view', 'home') + const [isMenuOpen, setIsMenuOpen] = useState(false) - const handleParse = () => { - if (!logInput.trim()) { - toast.error('Please paste a Docker build log first') - return - } - - const errors = parseDockerLog(logInput) - - if (errors.length === 0) { - toast.info('No errors detected in the log') - } else { - setParsedErrors(errors) - toast.success(`Found ${errors.length} error${errors.length > 1 ? 's' : ''}`) - } + const handleNavigation = (view: View) => { + setCurrentView(view) + setIsMenuOpen(false) } - const handleCopy = (text: string, label: string) => { - navigator.clipboard.writeText(text) - toast.success(`${label} copied to clipboard`) - } - - const filteredKnowledgeBase = knowledgeBase.filter(item => - item.title.toLowerCase().includes(searchQuery.toLowerCase()) || - item.category.toLowerCase().includes(searchQuery.toLowerCase()) || - item.explanation.toLowerCase().includes(searchQuery.toLowerCase()) - ) - return (
@@ -54,374 +25,109 @@ function App() {
-
-
-
-
- -
-
-

Docker Build Debugger

-

Analyze errors and get instant solutions

+
+
+
+
+
+ +
+
+

DevTools Hub

+

Your developer toolkit

+
+ + + + + + + + Navigation + + + +
- - - - - Log Analyzer - Analyze - - - - Knowledge Base - Knowledge - - - - - - -
-
- - - Paste Build Log - - - Copy your Docker build output and paste it below for analysis - -
-
-
- -