Download react-page/examples/pages/index.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 832 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-page/examples/pages/index.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-page/examples/pages/index.tsx
-
curl -L -o index.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-page/examples/pages/index.tsx
832 Bytes
| 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> | |
| ); | |
| } | |