'use client'; import { cn } from '@contractspec/lib.ui-kit-web/ui/utils'; import type { JourneyStepSpec } from '@contractspec/module.learning-journey/track-spec'; interface TipFeedItem { step: JourneyStepSpec; isCompleted: boolean; completedAt?: string; } interface TipFeedProps { items: TipFeedItem[]; } const TIP_ICONS: Record = { cash_buffer_too_high: '💰', no_savings_goal: '🎯', irregular_savings: '📅', noise_late_evening: '🔇', guest_frequency_high: '👥', shared_space_conflicts: '🏠', default: '💡', }; export function TipFeed({ items }: TipFeedProps) { if (items.length === 0) { return (
No tips yet. Start engaging with coaching tips!
); } return (
{/* Timeline line */}
{/* Feed items */}
{items.map((item) => { const tipId = (item.step.metadata?.tipId as string) ?? 'default'; const icon = TIP_ICONS[tipId] ?? TIP_ICONS.default; return (
{/* Node */}
{item.isCompleted ? '✓' : icon}
{/* Content */}

{item.step.title}

{item.step.description}

{item.step.xpReward && ( +{item.step.xpReward} XP )}
{/* Timestamp */}
{item.isCompleted ? ( ✓ Completed {item.completedAt && ` • ${item.completedAt}`} ) : ( Pending action )}
); })}
); }