2024-05-13 23:40:18 +02:00
|
|
|
// Copyright 2024, Command Line Inc.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2024-05-28 21:12:28 +02:00
|
|
|
import { Workspace } from "@/app/workspace/workspace";
|
|
|
|
import { atoms, globalStore } from "@/store/global";
|
2024-05-10 05:24:24 +02:00
|
|
|
import * as jotai from "jotai";
|
2024-05-14 06:42:25 +02:00
|
|
|
import { Provider } from "jotai";
|
2024-05-10 05:24:24 +02:00
|
|
|
|
2024-05-16 09:29:58 +02:00
|
|
|
import "../../public/style.less";
|
2024-05-27 22:59:58 +02:00
|
|
|
import { CenteredDiv } from "./element/quickelems";
|
2024-05-12 18:52:12 +02:00
|
|
|
|
2024-05-10 05:24:24 +02:00
|
|
|
const App = () => {
|
|
|
|
return (
|
2024-05-14 08:45:41 +02:00
|
|
|
<Provider store={globalStore}>
|
2024-05-10 05:24:24 +02:00
|
|
|
<AppInner />
|
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const AppInner = () => {
|
2024-05-27 22:59:58 +02:00
|
|
|
const client = jotai.useAtomValue(atoms.client);
|
|
|
|
const windowData = jotai.useAtomValue(atoms.waveWindow);
|
2024-05-24 23:08:24 +02:00
|
|
|
if (client == null || windowData == null) {
|
|
|
|
return (
|
|
|
|
<div className="mainapp">
|
2024-05-27 22:59:58 +02:00
|
|
|
<div className="titlebar"></div>
|
|
|
|
<CenteredDiv>invalid configuration, client or window was not loaded</CenteredDiv>
|
2024-05-24 23:08:24 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2024-05-10 05:24:24 +02:00
|
|
|
return (
|
2024-05-13 22:59:44 +02:00
|
|
|
<div className="mainapp">
|
|
|
|
<div className="titlebar"></div>
|
|
|
|
<Workspace />
|
2024-05-10 05:24:24 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export { App };
|