'use client' import { useMemo } from 'react' import Link from 'next/link' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import type { UsageData } from '@/lib/parse-logs' import { generateCoachInsights, type CraftScores } from '@/lib/coach' import { ArrowRight, AlertTriangle, Lightbulb, Flame } from 'lucide-react' function ScoreRing({ score, size = 100 }: { score: number; size?: number }) { const radius = (size - 14) / 2 const circumference = 2 * Math.PI * radius const offset = circumference - (score / 100) * circumference const getColor = (s: number) => { if (s >= 85) return 'var(--chart-2)' if (s >= 70) return 'var(--chart-1)' if (s >= 55) return 'var(--chart-3)' return 'var(--chart-5)' } return ( ) } const CRAFT_LABELS: { key: keyof CraftScores; letter: string; label: string; color: string }[] = [ { key: 'context', letter: 'C', label: 'Context', color: 'var(--chart-1)' }, { key: 'reach', letter: 'R', label: 'Reach', color: 'var(--chart-2)' }, { key: 'autonomy', letter: 'A', label: 'Autonomy', color: 'var(--chart-3)' }, { key: 'flow', letter: 'F', label: 'Flow', color: 'var(--chart-4)' }, { key: 'throughput', letter: 'T', label: 'Throughput', color: 'var(--chart-6)' }, ] function CraftBars({ craft }: { craft: CraftScores }) { return (
{insight.recommendation || insight.description}