// No build step: Orca strips the types, compiles the JSX and resolves `./todos` when it loads. import { atom, Badge, Button, Heading, IconButton, Input, on, Progress, read, Row, set, Stack, Text, ui, update, type PanelContext } from 'orca' import { TodoList } from './todo-list' import { add, clearDone, draft, openCount, percentDone, todos } from './todos' const themeSwitches = atom(0) /** Runs once before the first render; what it pushes to `subscriptions` ends with the panel. */ export function setup(ctx: PanelContext): void { ctx.subscriptions.push(on('theme', () => update(themeSwitches, (n) => n + 1))) } export default function Panel() { const open = read(openCount) return ( Tasks 0 ? 'accent' : 'neutral'}>{open} open {/* Feature-detect: an older Orca without Progress still renders the rest. */} {ui.has('Progress') ? : null} set(draft, value)} onSubmit={add} /> Written in TSX with no build step. Theme switches seen: {read(themeSwitches)}. ) }