{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-header",
  "type": "registry:block",
  "title": "Dashboard Header",
  "description": "The top of a dashboard: three trend cards, a this-period-versus-last chart you can scrub day by day, and a goal ring that fills as sales come in.",
  "categories": [
    "block",
    "Dashboards"
  ],
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/devl/dashboard-header.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { ArrowDownRightIcon, ArrowUpRightIcon, TargetIcon } from \"lucide-react\";\nimport { motion, useReducedMotion } from \"motion/react\";\nimport { type KeyboardEvent, type PointerEvent, useEffect, useId, useRef, useState } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n// Stays false until mounted so the server render and the first client render match.\nfunction useSafeReducedMotion() {\n  const prefers = useReducedMotion();\n  const [mounted, setMounted] = useState(false);\n  useEffect(() => setMounted(true), []);\n  return mounted && !!prefers;\n}\n\nexport interface DashboardDay {\n  label: string;\n  weekday: string;\n  revenue: number;\n  users: number;\n  orders: number;\n}\n\nexport type DashboardRange = 7 | 30 | 90;\n\nexport interface DashboardHeaderProps {\n  days?: DashboardDay[];\n  title?: string;\n  currency?: string;\n  dailyGoal?: number;\n  defaultRange?: DashboardRange;\n  className?: string;\n}\n\ntype MetricKey = \"revenue\" | \"users\" | \"orders\";\n\nconst metrics: { key: MetricKey; label: string; tone: string; mode: \"sum\" | \"avg\" }[] = [\n  { key: \"revenue\", label: \"Revenue\", tone: \"text-blue-600 dark:text-blue-400\", mode: \"sum\" },\n  { key: \"users\", label: \"Active users\", tone: \"text-emerald-600 dark:text-emerald-400\", mode: \"avg\" },\n  { key: \"orders\", label: \"Orders\", tone: \"text-amber-500 dark:text-amber-400\", mode: \"sum\" },\n];\nconst revenueTone = metrics[0].tone;\nconst settle = { type: \"spring\", stiffness: 300, damping: 34 } as const;\n\nconst ranges: { value: DashboardRange; label: string }[] = [\n  { value: 7, label: \"7D\" },\n  { value: 30, label: \"30D\" },\n  { value: 90, label: \"90D\" },\n];\n\nexport function sampleDashboardDays(count = 180): DashboardDay[] {\n  let seed = 20261024;\n  const rand = () => {\n    seed = (seed + 0x6d2b79f5) | 0;\n    let t = Math.imul(seed ^ (seed >>> 15), 1 | seed);\n    t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n    return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n  };\n  const end = Date.UTC(2026, 9, 24);\n  return Array.from({ length: count }, (_, i) => {\n    const date = new Date(end - (count - 1 - i) * 86_400_000);\n    const dow = date.getUTCDay();\n    const trend = 1 + (i / count) * 0.4;\n    const weekend = dow === 0 || dow === 6 ? 0.84 : 1;\n    const wave = 1 + 0.1 * Math.sin(i / 9 + 1);\n    const revenue = Math.round(1500 * trend * weekend * wave * (0.93 + rand() * 0.14));\n    return {\n      label: date.toLocaleDateString(\"en-US\", { month: \"short\", day: \"numeric\", timeZone: \"UTC\" }),\n      weekday: date.toLocaleDateString(\"en-US\", { weekday: \"short\", timeZone: \"UTC\" }),\n      revenue,\n      users: Math.round(640 * trend * (weekend * 0.6 + 0.4) * (0.95 + rand() * 0.1)),\n      orders: Math.round(revenue / (36 + rand() * 8)),\n    };\n  });\n}\n\nconst fallbackDays = sampleDashboardDays();\n\nfunction Roll({ text, className, instant }: { text: string; className?: string; instant?: boolean }) {\n  const reduce = useSafeReducedMotion();\n  const chars = text.split(\"\");\n  return (\n    <span className={cn(\"inline-flex tabular-nums leading-[1.15em]\", className)}>\n      <span className=\"sr-only\">{text}</span>\n      {chars.map((char, i) => {\n        const key = chars.length - i;\n        if (!/\\d/.test(char)) {\n          return (\n            <span aria-hidden key={`s${key}`}>\n              {char}\n            </span>\n          );\n        }\n        return (\n          <span aria-hidden className=\"relative inline-block h-[1.15em] w-[1ch] overflow-hidden\" key={`d${key}`}>\n            <motion.span\n              animate={{ y: `${-Number(char) * 1.15}em` }}\n              className=\"absolute inset-x-0 top-0 flex flex-col\"\n              initial={false}\n              transition={reduce || instant ? { duration: 0 } : settle}\n            >\n              {Array.from({ length: 10 }, (_, n) => (\n                <span className=\"block h-[1.15em]\" key={n}>\n                  {n}\n                </span>\n              ))}\n            </motion.span>\n          </span>\n        );\n      })}\n    </span>\n  );\n}\n\nfunction smoothPath(points: [number, number][]) {\n  if (points.length < 2) return \"\";\n  let d = `M${points[0][0]},${points[0][1]}`;\n  for (let i = 0; i < points.length - 1; i++) {\n    const p0 = points[i - 1] ?? points[i];\n    const p1 = points[i];\n    const p2 = points[i + 1];\n    const p3 = points[i + 2] ?? p2;\n    const c1x = p1[0] + (p2[0] - p0[0]) / 6;\n    const c1y = p1[1] + (p2[1] - p0[1]) / 6;\n    const c2x = p2[0] - (p3[0] - p1[0]) / 6;\n    const c2y = p2[1] - (p3[1] - p1[1]) / 6;\n    d += ` C${c1x},${c1y} ${c2x},${c2y} ${p2[0]},${p2[1]}`;\n  }\n  return d;\n}\n\nfunction toPoints(values: number[], lo: number, hi: number, w: number, h: number, pad = 6): [number, number][] {\n  const step = values.length > 1 ? w / (values.length - 1) : 0;\n  const span = hi - lo || 1;\n  return values.map((v, i) => [i * step, h - pad - ((v - lo) / span) * (h - pad * 2)]);\n}\n\nfunction Sparkline({ values, tone, hover }: { values: number[]; tone: string; hover: number | null }) {\n  const gradientId = `spark-${useId().replace(/:/g, \"\")}`;\n  const pts = toPoints(values, Math.min(...values) * 0.9, Math.max(...values) * 1.05, 100, 36, 3);\n  const line = smoothPath(pts);\n  const at = hover !== null ? pts[hover] : null;\n  return (\n    <div className={cn(\"relative h-9 w-full\", tone)}>\n      <svg aria-hidden className=\"absolute inset-0 size-full overflow-visible\" preserveAspectRatio=\"none\" viewBox=\"0 0 100 36\">\n        <defs>\n          <linearGradient id={gradientId} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n            <stop offset=\"0%\" stopColor=\"currentColor\" stopOpacity={0.2} />\n            <stop offset=\"100%\" stopColor=\"currentColor\" stopOpacity={0} />\n          </linearGradient>\n        </defs>\n        <path d={`${line} L100,36 L0,36 Z`} fill={`url(#${gradientId})`} />\n        <path d={line} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\" vectorEffect=\"non-scaling-stroke\" />\n      </svg>\n      {at && (\n        <span\n          className=\"absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-card bg-current\"\n          style={{ left: `${at[0]}%`, top: `${(at[1] / 36) * 100}%` }}\n        />\n      )}\n    </div>\n  );\n}\n\nexport function DashboardHeader({\n  days = fallbackDays,\n  title = \"Overview\",\n  currency = \"$\",\n  dailyGoal = 2000,\n  defaultRange = 30,\n  className,\n}: DashboardHeaderProps) {\n  const reduce = useSafeReducedMotion();\n  const uid = useId().replace(/:/g, \"\");\n  const [range, setRange] = useState<DashboardRange>(defaultRange);\n  const [hover, setHover] = useState<number | null>(null);\n  const plotRef = useRef<HTMLDivElement>(null);\n\n  const span = Math.min(range, Math.floor(days.length / 2));\n  const current = days.slice(-span);\n  const previous = days.slice(-span * 2, -span);\n  const money = (n: number) => `${currency}${Math.round(n).toLocaleString(\"en-US\")}`;\n  const plain = (n: number) => Math.round(n).toLocaleString(\"en-US\");\n  const fmt = (key: MetricKey, n: number) => (key === \"revenue\" ? money(n) : plain(n));\n  const total = (list: DashboardDay[], key: MetricKey, mode: \"sum\" | \"avg\") => {\n    const sum = list.reduce((acc, d) => acc + d[key], 0);\n    return mode === \"avg\" ? sum / Math.max(1, list.length) : sum;\n  };\n\n  const W = 600;\n  const H = 240;\n  const cur = current.map((d) => d.revenue);\n  const prev = previous.map((d) => d.revenue);\n  const rawMax = Math.max(...cur, ...prev);\n  const rawMin = Math.min(...cur, ...prev);\n  const rawTick = Math.max(1, rawMax - rawMin) / 3;\n  const magnitude = 10 ** Math.floor(Math.log10(rawTick));\n  const tick = [1, 2, 5, 10].map((n) => n * magnitude).find((n) => n >= rawTick) ?? rawTick;\n  const lo = Math.max(0, Math.floor((rawMin - tick * 0.5) / tick) * tick);\n  const max = Math.ceil((rawMax + tick * 0.15) / tick) * tick;\n  const yOf = (v: number) => H - 8 - ((v - lo) / (max - lo || 1)) * (H - 16);\n  const curPts = toPoints(cur, lo, max, W, H, 8);\n  const prevPts = toPoints(prev, lo, max, W, H, 8);\n  const curLine = smoothPath(curPts);\n  const prevLine = smoothPath(prevPts);\n  const gridValues: number[] = [];\n  for (let v = lo + tick; v <= max + 1; v += tick) gridValues.push(v);\n\n  const hovered = hover !== null ? current[hover] : null;\n  const hoveredPrev = hover !== null ? previous[hover] : null;\n\n  const pick = (event: PointerEvent<HTMLDivElement>) => {\n    const rect = plotRef.current?.getBoundingClientRect();\n    if (!rect) return;\n    const ratio = Math.min(1, Math.max(0, (event.clientX - rect.left) / rect.width));\n    setHover(Math.round(ratio * (current.length - 1)));\n  };\n\n  const onPlotKey = (event: KeyboardEvent<HTMLDivElement>) => {\n    if (event.key === \"ArrowRight\" || event.key === \"ArrowLeft\") {\n      event.preventDefault();\n      const delta = event.key === \"ArrowRight\" ? 1 : -1;\n      setHover((h) => Math.min(current.length - 1, Math.max(0, (h ?? (delta > 0 ? -1 : current.length)) + delta)));\n    } else if (event.key === \"Escape\") {\n      setHover(null);\n    }\n  };\n\n  const revenueTotal = total(current, \"revenue\", \"sum\");\n  const goal = dailyGoal * current.length;\n  const progress = Math.min(1, revenueTotal / goal);\n  const best = current.reduce((a, b) => (b.revenue > a.revenue ? b : a), current[0]);\n  const avg = revenueTotal / current.length;\n  const lastWeek = current.slice(-7).reduce((a, d) => a + d.revenue, 0) / Math.min(7, current.length);\n\n  const xLabels = [0, 0.25, 0.5, 0.75, 1].map((f) => current[Math.round(f * (current.length - 1))]?.label ?? \"\");\n\n  return (\n    <section className={cn(\"mx-auto w-full max-w-[1100px] space-y-4\", className)}>\n      <header className=\"flex flex-wrap items-end justify-between gap-3\">\n        <div>\n          <h2 className=\"font-semibold text-xl tracking-tight\">{title}</h2>\n          <p className=\"text-muted-foreground text-sm\">\n            {current[0]?.label} – {current[current.length - 1]?.label} vs previous {span} days\n          </p>\n        </div>\n        <div aria-label=\"Range\" className=\"inline-flex rounded-full border bg-muted p-1\" role=\"radiogroup\">\n          {ranges.map((r) => {\n            const active = r.value === range;\n            return (\n              <button\n                aria-checked={active}\n                className={cn(\n                  \"relative h-7 cursor-pointer rounded-full px-3.5 font-medium text-xs outline-none transition-colors duration-150 after:absolute after:-inset-y-1 after:inset-x-0 after:content-[''] focus-visible:ring-2 focus-visible:ring-ring\",\n                  active ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\",\n                )}\n                key={r.value}\n                onClick={() => {\n                  setRange(r.value);\n                  setHover(null);\n                }}\n                role=\"radio\"\n                type=\"button\"\n              >\n                {active && (\n                  <motion.span\n                    className=\"absolute inset-0 rounded-full bg-background shadow-xs/5 dark:bg-accent\"\n                    layoutId={`${uid}-range`}\n                    transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 500, damping: 44 }}\n                  />\n                )}\n                <span className=\"relative tabular-nums\">{r.label}</span>\n              </button>\n            );\n          })}\n        </div>\n      </header>\n\n      <div className=\"grid gap-4 sm:grid-cols-3\">\n        {metrics.map((m) => {\n          const value = total(current, m.key, m.mode);\n          const before = total(previous, m.key, m.mode);\n          const change = before ? (value - before) / before : 0;\n          const up = change >= 0;\n          const shown = hovered ? hovered[m.key] : value;\n          return (\n            <article className=\"rounded-2xl border bg-card p-4 shadow-xs/5\" key={m.key}>\n              <div className=\"flex items-center justify-between gap-2\">\n                <h3 className=\"flex items-center gap-2 text-muted-foreground text-sm\">\n                  <span className={cn(\"size-2 rounded-full bg-current\", m.tone)} />\n                  {m.label}\n                </h3>\n                <span\n                  className={cn(\n                    \"inline-flex items-center gap-0.5 rounded-full px-1.5 py-0.5 font-medium text-xs tabular-nums\",\n                    up ? \"bg-success/10 text-success-foreground\" : \"bg-destructive/10 text-destructive-foreground\",\n                  )}\n                >\n                  {up ? <ArrowUpRightIcon className=\"size-3\" /> : <ArrowDownRightIcon className=\"size-3\" />}\n                  {Math.abs(change * 100).toFixed(1)}%\n                </span>\n              </div>\n              <div className=\"mt-2 font-semibold text-2xl tracking-tight\">\n                <Roll instant={hover !== null} text={fmt(m.key, shown)} />\n              </div>\n              <p className=\"mt-0.5 h-4 text-muted-foreground text-xs\">\n                {hovered\n                  ? `${hovered.weekday}, ${hovered.label}`\n                  : m.mode === \"avg\"\n                    ? `Daily average, last ${span} days`\n                    : `Total, last ${span} days`}\n              </p>\n              <div className=\"mt-3\">\n                <Sparkline hover={hover} tone={m.tone} values={current.map((d) => d[m.key])} />\n              </div>\n            </article>\n          );\n        })}\n      </div>\n\n      <div className=\"grid gap-4 lg:grid-cols-3\">\n        <article className=\"rounded-2xl border bg-card p-4 shadow-xs/5 lg:col-span-2\">\n          <div className=\"flex flex-wrap items-center justify-between gap-2\">\n            <h3 className=\"font-medium text-sm\">Revenue, this period vs last</h3>\n            <div className=\"flex items-center gap-4 text-muted-foreground text-xs\">\n              <span className=\"flex items-center gap-1.5\">\n                <span className={cn(\"h-0.5 w-3.5 rounded-full bg-current\", revenueTone)} />\n                This period\n              </span>\n              <span className=\"flex items-center gap-1.5\">\n                <span className=\"w-3.5 border-muted-foreground/60 border-t-2 border-dashed\" />\n                Last period\n              </span>\n            </div>\n          </div>\n\n          <div className=\"relative mt-4 ps-10\">\n            <div className=\"pointer-events-none absolute inset-y-0 left-0 w-10\">\n              {gridValues.map((v) => (\n                <span\n                  className=\"absolute left-0 -translate-y-1/2 text-[0.6875rem] text-muted-foreground tabular-nums\"\n                  key={v}\n                  style={{ top: `${(yOf(v) / H) * 100}%` }}\n                >\n                  {v >= 1000 ? `${(v / 1000).toFixed(1).replace(/\\.0$/, \"\")}k` : Math.round(v)}\n                </span>\n              ))}\n            </div>\n            <div\n              aria-label=\"Revenue chart. Use arrow keys to inspect days.\"\n              className=\"relative h-56 cursor-crosshair touch-pan-y rounded-lg outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n              onBlur={() => setHover(null)}\n              onKeyDown={onPlotKey}\n              onPointerDown={pick}\n              onPointerLeave={() => setHover(null)}\n              onPointerMove={pick}\n              ref={plotRef}\n              role=\"img\"\n              tabIndex={0}\n            >\n              <svg aria-hidden className={cn(\"absolute inset-0 size-full overflow-visible\", revenueTone)} preserveAspectRatio=\"none\" viewBox={`0 0 ${W} ${H}`}>\n                <defs>\n                  <clipPath id={`${uid}-reveal`}>\n                    <motion.rect\n                      animate={{ width: W + 4 }}\n                      height={H + 8}\n                      initial={{ width: reduce ? W + 4 : 0 }}\n                      transition={{ duration: reduce ? 0 : 0.7, ease: [0.23, 1, 0.32, 1] }}\n                      x={-2}\n                      y={-4}\n                    />\n                  </clipPath>\n                  <linearGradient id={`${uid}-area`} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n                    <stop offset=\"0%\" stopColor=\"currentColor\" stopOpacity={0.16} />\n                    <stop offset=\"100%\" stopColor=\"currentColor\" stopOpacity={0} />\n                  </linearGradient>\n                </defs>\n                {gridValues.map((v) => {\n                  const y = yOf(v);\n                  return (\n                    <line\n                      className=\"stroke-border\"\n                      key={v}\n                      strokeDasharray=\"2 4\"\n                      vectorEffect=\"non-scaling-stroke\"\n                      x1={0}\n                      x2={W}\n                      y1={y}\n                      y2={y}\n                    />\n                  );\n                })}\n                <motion.path\n                  animate={{ opacity: 1 }}\n                  className=\"stroke-muted-foreground/50\"\n                  d={prevLine}\n                  fill=\"none\"\n                  initial={{ opacity: 0 }}\n                  key={`prev-${span}`}\n                  strokeDasharray=\"4 5\"\n                  strokeWidth=\"1.5\"\n                  transition={{ duration: reduce ? 0 : 0.2, ease: \"easeOut\" }}\n                  vectorEffect=\"non-scaling-stroke\"\n                />\n                <g clipPath={`url(#${uid}-reveal)`}>\n                  <motion.g\n                    animate={{ opacity: 1 }}\n                    initial={{ opacity: 0 }}\n                    key={`cur-${span}`}\n                    transition={{ duration: reduce ? 0 : 0.2, ease: \"easeOut\" }}\n                  >\n                    <path d={`${curLine} L${W},${H} L0,${H} Z`} fill={`url(#${uid}-area)`} />\n                    <path\n                      d={curLine}\n                      fill=\"none\"\n                      stroke=\"currentColor\"\n                      strokeLinecap=\"round\"\n                      strokeWidth=\"2.25\"\n                      vectorEffect=\"non-scaling-stroke\"\n                    />\n                  </motion.g>\n                </g>\n              </svg>\n\n              {hover !== null && hovered && (\n                <>\n                  <span\n                    className=\"pointer-events-none absolute inset-y-0 w-px bg-foreground/16\"\n                    style={{ left: `${(curPts[hover][0] / W) * 100}%` }}\n                  />\n                  {hoveredPrev && (\n                    <span\n                      className=\"pointer-events-none absolute size-2 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-card bg-muted-foreground\"\n                      style={{ left: `${(prevPts[hover][0] / W) * 100}%`, top: `${(prevPts[hover][1] / H) * 100}%` }}\n                    />\n                  )}\n                  <span\n                    className={cn(\"pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2\", revenueTone)}\n                    style={{ left: `${(curPts[hover][0] / W) * 100}%`, top: `${(curPts[hover][1] / H) * 100}%` }}\n                  >\n                    <motion.span\n                      animate={{ scale: 1, opacity: 1 }}\n                      className=\"block size-full rounded-full border-2 border-card bg-current\"\n                      initial={{ scale: reduce ? 1 : 0.6, opacity: 0 }}\n                      transition={{ duration: 0.15, ease: \"easeOut\" }}\n                    />\n                  </span>\n                  <div\n                    className={cn(\n                      \"pointer-events-none absolute top-2 z-10 w-44 rounded-xl border bg-popover p-3 text-xs shadow-xs/5\",\n                      hover > current.length / 2 ? \"-translate-x-[calc(100%+12px)]\" : \"translate-x-3\",\n                    )}\n                    style={{ left: `${(curPts[hover][0] / W) * 100}%` }}\n                  >\n                    <p className=\"font-medium\">\n                      {hovered.weekday}, {hovered.label}\n                    </p>\n                    <dl className=\"mt-2 space-y-1\">\n                      <div className=\"flex items-center justify-between gap-2\">\n                        <dt className=\"flex items-center gap-1.5 text-muted-foreground\">\n                          <span className={cn(\"size-1.5 rounded-full bg-current\", revenueTone)} />\n                          This period\n                        </dt>\n                        <dd className=\"font-medium tabular-nums\">{money(hovered.revenue)}</dd>\n                      </div>\n                      {hoveredPrev && (\n                        <div className=\"flex items-center justify-between gap-2\">\n                          <dt className=\"flex items-center gap-1.5 text-muted-foreground\">\n                            <span className=\"size-1.5 rounded-full bg-muted-foreground\" />\n                            {hoveredPrev.label}\n                          </dt>\n                          <dd className=\"tabular-nums\">{money(hoveredPrev.revenue)}</dd>\n                        </div>\n                      )}\n                      <div className=\"flex items-center justify-between gap-2 border-t pt-1\">\n                        <dt className=\"text-muted-foreground\">Orders</dt>\n                        <dd className=\"tabular-nums\">{plain(hovered.orders)}</dd>\n                      </div>\n                    </dl>\n                  </div>\n                </>\n              )}\n            </div>\n            <div className=\"mt-2 flex justify-between text-[0.6875rem] text-muted-foreground tabular-nums\">\n              {xLabels.map((label, i) => (\n                <span key={`${label}-${i}`}>{label}</span>\n              ))}\n            </div>\n          </div>\n        </article>\n\n        <article className=\"flex flex-col rounded-2xl border bg-card p-4 shadow-xs/5\">\n          <div className=\"flex items-center gap-2\">\n            <span className=\"flex size-7 items-center justify-center rounded-lg bg-blue-500/12 text-blue-600 dark:text-blue-400\">\n              <TargetIcon className=\"size-4\" />\n            </span>\n            <h3 className=\"font-medium text-sm\">Focus: revenue goal</h3>\n          </div>\n          <div className=\"mt-4 flex items-center gap-5\">\n            <div className=\"relative size-28 shrink-0\">\n              <svg aria-hidden className={cn(\"size-full -rotate-90\", revenueTone)} viewBox=\"0 0 100 100\">\n                <circle className=\"stroke-muted\" cx=\"50\" cy=\"50\" fill=\"none\" r=\"42\" strokeWidth=\"10\" />\n                <motion.circle\n                  animate={{ pathLength: progress }}\n                  cx=\"50\"\n                  cy=\"50\"\n                  fill=\"none\"\n                  initial={false}\n                  r=\"42\"\n                  stroke=\"currentColor\"\n                  strokeLinecap=\"round\"\n                  strokeWidth=\"10\"\n                  transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 120, damping: 22 }}\n                />\n              </svg>\n              <div className=\"absolute inset-0 flex flex-col items-center justify-center\">\n                <span className=\"font-semibold text-xl tracking-tight\">\n                  <Roll text={`${Math.round(progress * 100)}%`} />\n                </span>\n                <span className=\"text-[0.6875rem] text-muted-foreground\">of goal</span>\n              </div>\n            </div>\n            <div className=\"min-w-0 text-sm\">\n              <p className=\"text-muted-foreground text-xs\">Earned</p>\n              <p className=\"font-semibold\">\n                <Roll text={money(revenueTotal)} />\n              </p>\n              <p className=\"mt-2 text-muted-foreground text-xs\">Goal</p>\n              <p className=\"font-medium text-muted-foreground\">\n                <Roll text={money(goal)} />\n              </p>\n            </div>\n          </div>\n          <dl className=\"mt-auto space-y-2 border-t pt-4 text-sm\">\n            <div className=\"flex items-center justify-between\">\n              <dt className=\"text-muted-foreground\">Best day</dt>\n              <dd className=\"font-medium tabular-nums\">\n                {best?.label} · <Roll text={money(best?.revenue ?? 0)} />\n              </dd>\n            </div>\n            <div className=\"flex items-center justify-between\">\n              <dt className=\"text-muted-foreground\">Average per day</dt>\n              <dd className=\"font-medium\">\n                <Roll text={money(avg)} />\n              </dd>\n            </div>\n            <div className=\"flex items-center justify-between\">\n              <dt className=\"text-muted-foreground\">Last 7 days pace</dt>\n              <dd\n                className={cn(\n                  \"font-medium\",\n                  lastWeek >= dailyGoal ? \"text-success-foreground\" : \"text-warning-foreground\",\n                )}\n              >\n                <Roll text={money(lastWeek)} />\n                <span className=\"text-muted-foreground text-xs\"> /day</span>\n              </dd>\n            </div>\n          </dl>\n        </article>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}