spb/worthdoing Public
Autonomous investigation agent that discovers, challenges, and ranks things genuinely worth doing — Claude + Firecrawl, Next.js 16, PostgreSQL
TypeScript 91.5%
SQL 5.8%
CSS 2.2%
1/**2 * WorthDoing.ai3 * Author: Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 * File: src/components/wd/StatsBar.tsx6 * Description: Sticky budget/telemetry bar — searches, reads, evidence, steps, live cost.7 */8"use client";910import type { UiBudget, UiBudgetUsed } from "@/lib/ui/api";1112function Stat({ label, value, max }: { label: string; value: number | string; max?: number }) {13 return (14 <div className="flex min-w-0 flex-col items-center px-2 py-1 sm:px-3">15 <span className="font-mono text-sm font-medium text-ink">16 {value}17 {max !== undefined && <span className="text-ink-soft/70">/{max}</span>}18 </span>19 <span className="font-mono text-[9px] uppercase tracking-widest text-ink-soft">{label}</span>20 </div>21 );22}2324export function StatsBar({25 budget,26 used,27 evidenceCount,28 hypothesisCount,29}: {30 budget: UiBudget;31 used: UiBudgetUsed;32 evidenceCount: number;33 hypothesisCount: number;34}) {35 return (36 <div className="flex items-center justify-between divide-x divide-line overflow-x-auto rounded-lg border border-line bg-card">37 <Stat label="steps" value={used.agentSteps} max={budget.maxAgentSteps} />38 <Stat label="searches" value={used.searches} max={budget.maxSearches} />39 <Stat label="reads" value={used.scrapes} max={budget.maxScrapes} />40 <Stat label="hypotheses" value={hypothesisCount} />41 <Stat label="evidence" value={evidenceCount} />42 <Stat label="cost" value={`$${used.costUsd.toFixed(2)}`} />43 </div>44 );45}46