feat: init @affine/docs (#2849)
This commit is contained in:
26
apps/docs/src/app.tsx
Normal file
26
apps/docs/src/app.tsx
Normal file
@@ -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