Download react-page/examples/pages/old/demo.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-page/examples/pages/old/demo.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-page/examples/pages/old/demo.tsx
-
curl -L -o demo.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-page/examples/pages/old/demo.tsx
721 Bytes
| import type { Options, Value, Value_v0 } 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 contents from '../../sampleContents/v0'; | |
| const LANGUAGES = [ | |
| { | |
| lang: 'en', | |
| label: 'English', | |
| }, | |
| { | |
| lang: 'de', | |
| label: 'Deutsch', | |
| }, | |
| ]; | |
| export default function Home() { | |
| const [value, setValue] = useState<Value_v0 | Value>(contents[0]); | |
| return ( | |
| <PageLayout> | |
| <Editor | |
| cellPlugins={cellPlugins} | |
| value={value} | |
| onChange={setValue} | |
| languages={LANGUAGES} | |
| /> | |
| </PageLayout> | |
| ); | |
| } | |