'use client' import { motion } from 'motion/react' import { Loader2 } from 'lucide-react' import { ArrowRight, GitBranch, Lightbulb, Link2, BookOpen, Inbox, GraduationCap, Compass, Plus, Sparkles, PenLine, } from 'lucide-react' import type { LucideIcon } from 'lucide-react' import { useLanguage } from '@/lib/i18n' import { DashboardWidgetTitleRow } from '@/components/dashboard-widget-title-row' import type { DashboardPath, DashboardPathType } from '@/lib/dashboard/path-types' const TYPE_META: Record = { continue: { Icon: PenLine, accent: 'text-ink' }, connect: { Icon: Link2, accent: 'text-brand-accent' }, 'add-link': { Icon: Plus, accent: 'text-emerald-600' }, bridge: { Icon: GitBranch, accent: 'text-violet-600' }, research: { Icon: Sparkles, accent: 'text-sky-600' }, explore: { Icon: Compass, accent: 'text-amber-600' }, organize: { Icon: Inbox, accent: 'text-brand-accent' }, review: { Icon: GraduationCap, accent: 'text-brand-accent' }, resurface: { Icon: Lightbulb, accent: 'text-brand-accent' }, daily: { Icon: BookOpen, accent: 'text-concrete' }, } export interface DashboardNextPathsProps { paths: DashboardPath[] loading?: boolean enriching?: boolean focusNoteTitle?: string | null onAction: (path: DashboardPath) => void prefersReducedMotion?: boolean } export function DashboardNextPaths({ paths, loading, enriching, focusNoteTitle, onAction, prefersReducedMotion, }: DashboardNextPathsProps) { const { t } = useLanguage() if (loading) { return (
{focusNoteTitle && (

{t('homeDashboard.pathsFromNote', { title: focusNoteTitle })}

)}

{t('homeDashboard.pathsLoading')}

) } if (paths.length === 0) { return (

{t('homeDashboard.pathsEmpty')}

) } const hero = paths[0] const rest = paths.slice(1, 5) const HeroIcon = TYPE_META[hero.type].Icon return (
{t('homeDashboard.pathsEnriching')} ) : undefined} /> {focusNoteTitle && (

{t('homeDashboard.pathsFromNote', { title: focusNoteTitle })}

)}
onAction(hero)} whileHover={prefersReducedMotion ? undefined : { y: -1 }} className="w-full text-start px-5 py-4 hover:bg-brand-accent/[0.03] transition-colors border-b border-border/10" >

{t(`homeDashboard.pathTypes.${hero.type}`)} {hero.score ? ` ยท ${hero.score}%` : ''}

{hero.title}

{hero.description}

{t(`homeDashboard.pathActions.${hero.actionKey}`)}
{rest.length > 0 && (
{rest.map(path => { const meta = TYPE_META[path.type] const Icon = meta.Icon return ( ) })}
)}
) }