initial commit

This commit is contained in:
Luck
2021-03-26 22:00:12 +00:00
commit bbbece5b3b
16 changed files with 11936 additions and 0 deletions

18
src/components/Editor.js Normal file
View File

@@ -0,0 +1,18 @@
import { useState, useEffect } from 'react';
import EditorControls from './EditorControls';
import EditorTextArea from './EditorTextArea';
export default function Editor({ content, setContent, contentType }) {
const [language, setLanguage] = useState('plain');
useEffect(() => {
if (contentType) {
setLanguage(contentType);
}
}, [contentType]);
return <>
<EditorControls code={content} language={language} setLanguage={setLanguage} />
<EditorTextArea code={content} setCode={setContent} language={language} />
</>
}