19 lines
442 B
TypeScript
19 lines
442 B
TypeScript
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}</>}
|
|
/>
|
|
);
|
|
}
|