/** * CommandPillar.tsx — 4 Pillar Navigation System * Sostituisce il menu laterale con 4 bottoni principali (Pillar) che espandono sottocategorie logiche. * * Pillar 1: 🔍 RICERCA & ANALISI * - Web Search, News, Meteo, Analisi Dati * * Pillar 2: 💻 SVILUPPO & CODING * - Code Review, Refactor, Debug, Test * * Pillar 3: 🤖 AUTOMAZIONE & TASK * - Task Automation, Workflow, Scheduling, Integration * * Pillar 4: 🎨 CREATIVITÀ & CONTENUTI * - Generazione Testo, Immagini, Audio, Brainstorming */ import React, { useState } from "react"; import { Search, Code2, Zap, Sparkles, ChevronDown, X } from "lucide-react"; export interface PillarCommand { id: string; label: string; description?: string; icon?: React.ReactNode; shortcut?: string; action: () => void; } export interface Pillar { id: string; name: string; icon: React.ReactNode; color: string; commands: PillarCommand[]; } interface CommandPillarProps { onCommandSelect: (cmd: PillarCommand) => void; isOpen?: boolean; onClose?: () => void; } const PILLARS: Pillar[] = [ { id: "search", name: "Ricerca & Analisi", icon: , color: "#3b82f6", commands: [ { id: "web-search", label: "Web Search", description: "Cerca il web in tempo reale", action: () => {} }, { id: "news", label: "Notizie", description: "Ultime notizie e trend", action: () => {} }, { id: "weather", label: "Meteo", description: "Previsioni meteo per città", action: () => {} }, { id: "data-analysis", label: "Analisi Dati", description: "Elabora e visualizza dati", action: () => {} }, ], }, { id: "coding", name: "Sviluppo & Coding", icon: , color: "#10b981", commands: [ { id: "code-review", label: "Code Review", description: "Analizza e migliora codice", action: () => {} }, { id: "refactor", label: "Refactor", description: "Rifattorizza il codice", action: () => {} }, { id: "debug", label: "Debug", description: "Trova e risolvi bug", action: () => {} }, { id: "test", label: "Test", description: "Genera test e verifica", action: () => {} }, ], }, { id: "automation", name: "Automazione & Task", icon: , color: "#f59e0b", commands: [ { id: "task-auto", label: "Task Automation", description: "Automatizza compiti ripetitivi", action: () => {} }, { id: "workflow", label: "Workflow", description: "Crea flussi di lavoro", action: () => {} }, { id: "scheduling", label: "Scheduling", description: "Pianifica esecuzioni", action: () => {} }, { id: "integration", label: "Integrazione", description: "Connetti servizi esterni", action: () => {} }, ], }, { id: "creative", name: "Creatività & Contenuti", icon: , color: "#a855f7", commands: [ { id: "text-gen", label: "Generazione Testo", description: "Crea contenuti scritti", action: () => {} }, { id: "image-gen", label: "Generazione Immagini", description: "Crea immagini con IA", action: () => {} }, { id: "audio-gen", label: "Generazione Audio", description: "Crea audio e musica", action: () => {} }, { id: "brainstorm", label: "Brainstorming", description: "Genera idee creative", action: () => {} }, ], }, ]; export const CommandPillar: React.FC = ({ onCommandSelect, isOpen = false, onClose }) => { const [expandedPillar, setExpandedPillar] = useState(null); const handlePillarClick = (pillarId: string) => { setExpandedPillar(expandedPillar === pillarId ? null : pillarId); }; const handleCommandClick = (cmd: PillarCommand) => { onCommandSelect(cmd); setExpandedPillar(null); onClose?.(); }; if (!isOpen) return null; return (
e.stopPropagation()} > {/* Header */}

Comandi Rapidi

{/* Pillars */}
{PILLARS.map((pillar) => (
{/* Pillar Button */} {/* Expanded Commands */} {expandedPillar === pillar.id && (
{pillar.commands.map((cmd) => ( ))}
)}
))}
); }; export default CommandPillar;