'use client'; import { type ActionItem } from '@/lib/copilot'; interface ActionPreviewProps { actions: ActionItem[]; onConfirm: (action: ActionItem) => void; onDismiss: (action: ActionItem) => void; } const ACTION_LABELS: Record = { search_vehicles: 'Fahrzeuge durchsuchen', search_contacts: 'Kontakte durchsuchen', get_sale_overview: 'Verkaufsuebersicht abrufen', create_vehicle: 'Fahrzeug anlegen', create_contact: 'Kontakt anlegen', }; export function ActionPreview({ actions, onConfirm, onDismiss }: ActionPreviewProps) { if (actions.length === 0) return null; return (

Der Copilot moechte folgende Aktionen ausfuehren:

{actions.map((action, idx) => (

{ACTION_LABELS[action.type] || action.type}

{Object.entries(action.params).map(([key, value]) => `${key}: ${String(value)}` ).join(', ') || 'Keine Parameter'}

))}
); }