Build base web
This commit is contained in:
18
virtweb_frontend/src/widgets/LoadServerConfig.tsx
Normal file
18
virtweb_frontend/src/widgets/LoadServerConfig.tsx
Normal file
@ -0,0 +1,18 @@
|
||||
import { PropsWithChildren } from "react";
|
||||
import { AsyncWidget } from "./AsyncWidget";
|
||||
import { ServerApi } from "../api/ServerApi";
|
||||
|
||||
export function LoadServerConfig(p: PropsWithChildren): React.ReactElement {
|
||||
const load = async () => {
|
||||
await ServerApi.LoadConfig();
|
||||
};
|
||||
|
||||
return (
|
||||
<AsyncWidget
|
||||
loadKey={0}
|
||||
errMsg="Failed to load server config!"
|
||||
load={load}
|
||||
build={() => <>{p.children}</>}
|
||||
/>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user