mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
feat: init @affine/docs (#2849)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
'use server';
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
|
||||
import type { ReactElement } from 'react';
|
||||
import { lazy } from 'react';
|
||||
|
||||
const Editor = lazy(() =>
|
||||
import('./components/editor.js').then(({ Editor }) => ({ default: Editor }))
|
||||
);
|
||||
|
||||
const markdown = await fs.readFile(path.join('./src/pages/index.md'), {
|
||||
encoding: 'utf-8',
|
||||
});
|
||||
|
||||
const App = (): ReactElement => {
|
||||
return (
|
||||
<div>
|
||||
<div className="mt-5">
|
||||
<Editor text={markdown} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
Reference in New Issue
Block a user