This repository has been archived on 2025-05-09. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Astral-nook/resources/scripts/components/server/files/FileEditContainer.tsx
2019-10-19 15:31:02 -07:00

23 lines
664 B
TypeScript

import React, { lazy } from 'react';
import { ServerContext } from '@/state/server';
const LazyAceEditor = lazy(() => import(/* webpackChunkName: "editor" */'@/components/elements/AceEditor'));
export default () => {
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
let ref: null| (() => Promise<string>) = null;
setTimeout(() => ref && ref().then(console.log), 5000);
return (
<div className={'my-10'}>
<LazyAceEditor
fetchContent={value => {
ref = value;
}}
onContentSaved={() => null}
/>
</div>
);
};