'use client' import { motion } from 'motion/react' import { Layers, Zap, ArrowUpRight } from 'lucide-react' import { useLanguage } from '@/lib/i18n' import { DashboardWidgetTitleRow } from '@/components/dashboard-widget-title-row' interface Cluster { clusterId: number name?: string noteIds: string[] } interface BridgeNote { noteId: string bridgeScore: number clusterNames?: string[] note?: { id: string; title: string | null } } const CLUSTER_COLORS = ['#F87171', '#60A5FA', '#34D399', '#FBBF24', '#A78BFA', '#F472B6', '#2DD4BF'] export interface DashboardMindOrbitProps { clusters: Cluster[] bridgeNotes: BridgeNote[] loading?: boolean onOpenInsights: () => void onNoteSelect: (id: string) => void prefersReducedMotion?: boolean } export function DashboardMindOrbit({ clusters, bridgeNotes, loading, onOpenInsights, onNoteSelect, prefersReducedMotion, }: DashboardMindOrbitProps) { const { t } = useLanguage() const topClusters = [...clusters] .sort((a, b) => b.noteIds.length - a.noteIds.length) .slice(0, 5) const maxCount = topClusters[0]?.noteIds.length || 1 const topBridge = bridgeNotes[0] if (loading) { return
} if (topClusters.length === 0) { return ( ) } return (