import React, { useState } from 'react'; import { Briefcase, FileText, Download, Loader2, CheckCircle, ArrowRight, Sparkles, Building2 } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Textarea } from '@/components/ui/textarea'; import { API_URL } from '@/config/api'; import { cn } from '@/lib/utils'; interface GeneratedPresentation { filename: string; url: string; } export default function TDCSolutionWidget() { const [customerName, setCustomerName] = useState(''); const [need, setNeed] = useState(''); const [isGenerating, setIsGenerating] = useState(false); const [result, setResult] = useState(null); const [error, setError] = useState(null); const handleGenerate = async () => { if (!customerName.trim() || !need.trim()) return; setIsGenerating(true); setError(null); setResult(null); try { // Call the TDC Generator Tool via MCP route const response = await fetch(`${API_URL}/api/mcp/route`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ tool: 'tdc.generate_presentation', params: { customerName, need } }) }); const data = await response.json(); if (data.result && data.result.success) { setResult(data.result.data); } else { throw new Error(data.result?.error || 'Generation failed'); } } catch (err: any) { console.error('Generation error:', err); setError(err.message || 'Failed to generate presentation'); } finally { setIsGenerating(false); } }; const handleReset = () => { setResult(null); setError(null); setCustomerName(''); setNeed(''); }; return (
{/* TDC Brand Header Bar */}
{/* Header */}

TDC Erhverv

LØSNINGSDESIGNER

{result && ( )}
{/* Content */}
{!result ? (
setCustomerName(e.target.value)} placeholder="Virksomhedens navn..." className="bg-slate-50 border-slate-200 focus:ring-[#0000BF] text-slate-900 placeholder:text-slate-400" />