import { useState } from 'react'; import type { Suggestion } from './api'; const typeConfig = { info: { icon: '💡', color: 'blue', bg: 'bg-blue-50', border: 'border-blue-200', text: 'text-blue-700', bar: 'bg-blue-500' }, warning: { icon: '⚠️', color: 'orange', bg: 'bg-orange-50', border: 'border-orange-200', text: 'text-orange-700', bar: 'bg-orange-500' }, action: { icon: '✅', color: 'green', bg: 'bg-green-50', border: 'border-green-200', text: 'text-green-700', bar: 'bg-green-500' }, insight: { icon: '🔍', color: 'purple', bg: 'bg-purple-50', border: 'border-purple-200', text: 'text-purple-700', bar: 'bg-purple-500' }, }; interface SuggestionCardProps { suggestion: Suggestion; onDismiss: (id: string) => void; onAct: (id: string, actionIndex: number) => void; } export function SuggestionCard({ suggestion, onDismiss, onAct }: SuggestionCardProps) { const [expanded, setExpanded] = useState(false); const config = typeConfig[suggestion.suggestion_type] || typeConfig.info; const confidencePercent = Math.round(suggestion.confidence * 100); return (
{suggestion.content}
{/* Confidence Bar */}