Browser UI

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
thalladaandClaude Fable 5.2 committed 2026-11-15 14:30:50 -05:00
1 parent dfa08f6e0c
commit dbd64aa591
17 files changed
+7118

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
/** The footer's usage figures: what is left of the plan (subscription only) and what this session used. */
import { useEffect, useReducer } from "preact/hooks";
import { onUsage, startUsage, usageNow, view } from "./usage";
export function Usage() {
const [, tick] = useReducer((x: number) => x + 1, 0);
useEffect(() => {
const off = onUsage(() => tick(0));
const stop = startUsage();
return () => {
off();
stop();
};
}, []);
const v = view(usageNow());
if (!v) return null;
return (
<span class="usage">
{v.plan && (
<span class={`usage-plan${v.plan.attn ? " attn" : ""}${v.plan.limited ? " limited" : ""}`} title={v.plan.title}>
{v.plan.text}
</span>
)}
{v.session && (
<span class="usage-session" title={v.session.title} data-calls={v.session.calls}>
{v.session.text}
</span>
)}
</span>
);
}