okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-0243-gui into f-0243-rel (Chat.tsx and DropZone.tsx: the guifix clipboard helpers kept at the conflicts, copyAndTell stays for Markdown and Serving)061a28583

main
1.4 KiB20 linesraw
1import { tr } from '../lib/i18n';
2import { GuidedSetup } from '../components/GuidedSetup';
3import { useNative } from '../lib/native';
4import { useStore } from '../lib/store';
5import { useEngineUnpacking } from '../lib/engine-setup';
6import { EngineFirstRun, useEngineNeeded } from '../components/EngineFirstRun';
7import { useEffect, useState } from 'react';
8/** Every setup entry uses the same guided onboarding. */
9export function SetupScreen() {
10    const native = useNative(), setup = useStore(s => s.setup);
11    const needsEngine = useEngineNeeded(), [engineStepDone, setEngineStepDone] = useState(false), [cardShown, setCardShown] = useState(false);
12    useEffect(() => { if (needsEngine) setCardShown(true); }, [needsEngine]);
13    const unpacking = useEngineUnpacking(!native || !setup);
14    // No engine on this PC yet: the first-run card comes before the model steps (it works before the native snapshot has connected).
15    if (!engineStepDone && !setup?.complete && (needsEngine || cardShown))
16        return <EngineFirstRun onDone={() => setEngineStepDone(true)}/>;
17    if (!native || !setup)
18        return <div className="setup guided-onboarding"><p className="onboard-loading" role="status">{tr("Getting your setup ready\u2026")}</p>{unpacking ? <p className="onboard-loading small" role="status">{tr("Unpacking the engine that came with the app. This takes about a minute the first time.")}</p> : null}</div>;
19    return <GuidedSetup />;
20}