import { ArrowUpRight, Sparkles } from 'lucide-react'; import { cn } from '@/lib/utils'; import { __ } from '../lib/i18n'; export interface ReadinessRecommendation { id: string; message: string; action_label?: string; action_url?: string; } /** Normalize legacy string recommendations from older API responses. */ export function normalizeRecommendations( items: ReadinessRecommendation[] | string[] | undefined | null ): ReadinessRecommendation[] { if (!items || items.length === 0) { return []; } return items.map((item, index) => { if (typeof item === 'string') { return { id: `legacy-${index}`, message: item }; } return item; }); } export function ReadinessRecommendationsList({ items, limit = 5, className = '', }: { items: ReadinessRecommendation[] | string[]; limit?: number; className?: string; }) { const normalized = normalizeRecommendations(items).slice(0, limit); if (normalized.length === 0) { return null; } return (
); }