import { Loader2 } from "lucide-react"; import { useEffect, useState, type ButtonHTMLAttributes, type InputHTMLAttributes, type ReactNode, type TextareaHTMLAttributes } from "react"; import { api, type Catalog } from "../lib/api"; import { useI18n } from "../lib/i18n"; /* ---------- brand ---------- */ export function Logo({ size = 28 }: { size?: number }) { return ( EvalBot ); } /* ---------- waveform: the visual signature (voice) ---------- */ export function Waveform({ levels, bars = 28, animated = false, className = "", color = "var(--color-amber)" }: { levels?: number[]; bars?: number; animated?: boolean; className?: string; color?: string }) { const values = levels ?? Array.from({ length: bars }, (_, i) => 0.35 + 0.65 * Math.abs(Math.sin(i * 1.7) * Math.cos(i * 0.6))); return ( ); } /* ---------- buttons & fields ---------- */ type BtnProps = ButtonHTMLAttributes & { variant?: "primary" | "quiet" | "outline" | "danger"; busy?: boolean; size?: "md" | "lg" }; export function Button({ variant = "primary", busy, size = "md", className = "", children, disabled, ...rest }: BtnProps) { const base = "inline-flex items-center justify-center gap-2 rounded-xl font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed"; const sizes = size === "lg" ? "px-6 py-3.5 text-base" : "px-4 py-2.5 text-[15px]"; const styles = { primary: "bg-nile text-white hover:bg-nile-deep dark:text-paper", quiet: "text-ink hover:bg-sunken", outline: "border border-line bg-surface text-ink hover:border-nile hover:text-nile", danger: "bg-danger text-white hover:opacity-90", }[variant]; return ( ); } export function Field({ label, hint, children }: { label: string; hint?: string; children: ReactNode }) { return ( ); } const inputCls = "w-full rounded-xl border border-line bg-surface px-3.5 py-2.5 text-[15px] text-ink placeholder:text-muted/70 focus:border-nile focus:outline-none"; export const Input = (p: InputHTMLAttributes) => ; export const Textarea = (p: TextareaHTMLAttributes) =>