import { useState, useEffect } from "react"; import { Loader2 } from "lucide-react"; import { useLLM } from "../hooks/useLLM"; import { ChatApp } from "./ChatApp"; export function AppShell() { const { status } = useLLM(); const isReady = status.state === "ready"; const [showChat, setShowChat] = useState(false); useEffect(() => { if (isReady) { const timeoutId = setTimeout(() => setShowChat(true), 300); return () => clearTimeout(timeoutId); } }, [isReady]); return ( <>
{status.state === "loading" ? (status.message ?? "Loading model…") : status.state === "error" ? "Error" : "Preparing Nemotron-3-Nano…"}
{status.error}
)}