File size: 832 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import { Button } from '@mui/material';
import type { Value } from '@react-page/editor';
import Editor from '@react-page/editor';
import React, { useState } from 'react';
import PageLayout from '../components/PageLayout';
import { cellPlugins } from '../plugins/cellPlugins';
import { demo } from '../sampleContents/demo';
const LANGUAGES = [
{
lang: 'en',
label: 'English',
},
{
lang: 'de',
label: 'Deutsch',
},
];
export default function Home() {
const [value, setValue] = useState<Value>(demo);
const reset = () => setValue(demo);
return (
<PageLayout>
<Editor
cellPlugins={cellPlugins}
value={value}
lang={LANGUAGES[0].lang}
onChange={setValue}
languages={LANGUAGES}
/>
<Button onClick={reset}>Reset</Button>
</PageLayout>
);
}
|