2019-10-19 23:31:02 +01:00
|
|
|
import React, { lazy } from 'react';
|
2019-09-28 22:59:05 +01:00
|
|
|
import { ServerContext } from '@/state/server';
|
2019-10-12 23:29:45 +01:00
|
|
|
|
2019-10-19 23:31:02 +01:00
|
|
|
const LazyAceEditor = lazy(() => import(/* webpackChunkName: "editor" */'@/components/elements/AceEditor'));
|
2019-10-19 22:51:10 +01:00
|
|
|
|
2019-08-17 19:40:51 +01:00
|
|
|
export default () => {
|
2019-09-28 22:59:05 +01:00
|
|
|
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
|
|
|
|
|
2019-10-19 23:31:02 +01:00
|
|
|
let ref: null| (() => Promise<string>) = null;
|
2019-10-12 23:29:45 +01:00
|
|
|
|
2019-10-19 23:31:02 +01:00
|
|
|
setTimeout(() => ref && ref().then(console.log), 5000);
|
2019-08-17 19:40:51 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={'my-10'}>
|
2019-10-19 23:31:02 +01:00
|
|
|
<LazyAceEditor
|
|
|
|
fetchContent={value => {
|
|
|
|
ref = value;
|
|
|
|
}}
|
|
|
|
onContentSaved={() => null}
|
|
|
|
/>
|
2019-08-17 19:40:51 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|