import { useRef, useState } from "preact/hooks"; import { DEBUG } from "../app/config.ts"; import { takeOver } from "../app/lifecycle.ts"; import { store, ui } from "../app/store.ts"; import { BrainNotice, UpgradeDialog } from "./Brain.tsx"; import { Chat } from "./Chat.tsx"; import { Debug } from "./Debug.tsx"; import { Device } from "./Device.tsx"; import { Diary } from "./Diary.tsx"; import { Settings } from "./Settings.tsx"; import { Icon, useApp } from "./shared.tsx"; import { Shelf } from "./Shelf.tsx"; const tabs = [ ["chat", "chat"], ["diary", "diary"], ["shelf", "shelf"], ["care", "settings"], ...(DEBUG ? [["debug", "debug"]] : []), ]; export function App() { useApp(); const [active, setActive] = useState("chat"); const buttons = useRef(null); if (!store.tabOwned) return ( ); return ( <>
{tabs.map(([id, label], i) => ( ))}
{tabs.map(([id]) => ( ))}
{ui.toasts.map((t) => (
{t.icon && } {t.text}
))}
); }