VirtWeb/virtweb_frontend/src/widgets/LoadServerConfig.tsx

19 lines
442 B
TypeScript
Raw Normal View History

2023-09-04 12:11:56 +00:00
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}</>}
/>
);
}