import React, { useState } from 'react'; import type { KICopilotProps } from '../types/ui.types'; const defaultSuggestions = [ { id: 's1', icon: , label: '5 Reihen à 22 Stühle anlegen' }, { id: 's2', icon: , label: 'Optimale Bestuhlung vorschlagen' }, { id: 's3', icon: , label: 'Überlappende Stühle finden' }, ]; const defaultMessages = [ { id: 'm1', role: 'user' as const, content: 'Lege 5 Reihen mit je 22 Stühlen parallel zur Bühne an, Abstand 1m.' }, { id: 'm2', role: 'assistant' as const, content: Ich erstelle 110 Stühle in 5 Reihen (Y=2,5m/3,5m/4,5m/5,5m/6,5m; X-Start=2,5m; 22 Stühle × 0,5m + 0,1m Abstand). Los geht's! ● function_call: placeSeating(rows=5, cols=22, gap=1.0) }, ]; const KICopilot: React.FC = ({ messages, suggestions, onSend, onSuggestionClick, loading }) => { const [input, setInput] = useState(''); const allMessages = messages.length > 0 ? messages : defaultMessages; const allSuggestions = suggestions.length > 0 ? suggestions : defaultSuggestions; const handleSend = () => { if (input.trim()) { onSend(input.trim()); setInput(''); } }; return ( <>
KI Copilot
Powered by Claude
Online
Schnell-Aktionen
{allSuggestions.map((s) => ( ))}
{allMessages.map((msg) => (
{msg.content}
))} {loading && (
)}
setInput(e.target.value)} onKeyDown={(e) => { if (e.key === 'Enter') handleSend(); }} />
); }; export default KICopilot;