import { ArrowUp, CalendarDays, Check, ChevronDown, Square } from 'lucide-react' import { RadioGroup } from 'radix-ui' import { useState } from 'react' import { Button } from '@/components/ui/button' import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover' import { SYSTEMS } from '@/lib/content' import { percent, seconds } from '@/lib/format' import type { SystemId, SystemsFile } from '@/lib/types' import { cn } from '@/lib/utils' /** The question box: text, then a row with the policy date, the system and send/stop. * Enter sends, Shift+Enter is a new line (as in Claude and ChatGPT). */ export function Composer({ system, onSystem, day, onDay, numbers, busy, live, onSend, onStop, }: { system: SystemId onSystem: (s: SystemId) => void day: string | null onDay: (d: string | null) => void numbers: SystemsFile | null busy: boolean live: boolean // the backend answers questions onSend: (question: string) => void onStop: () => void }) { const [text, setText] = useState('') const ready = live && !busy && text.trim().length >= 3 function send() { if (!ready) return onSend(text.trim()) setText('') } return (
Policy effective date
Answers use the versions of each form and law in force on this date.
onDay(e.target.value || null)} className="w-full rounded-md border px-2 py-1.5" aria-label="Policy effective date" /> {day && ( )}Accuracy on {numbers.systems.c.n} held-out questions, written and graded by an LLM. Details on the Evals page.
)}