import React, { useEffect, useState, useCallback } from "react";
import logo_light from "../assets/logo_light_46.png";
import logo_dark from "../assets/logo_dark_46.png";
import { Banner, Button, Input, Upload } from "@douyinfe/semi-ui";
import {
IconSun,
IconMoon,
IconGithubLogo,
IconPaperclip,
} from "@douyinfe/semi-icons";
import RichEditor from "../components/rich_editor";
import { LexicalComposer } from "@lexical/react/LexicalComposer";
import { editorConfig } from "../data/editor_config";
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
import { $generateHtmlFromNodes } from "@lexical/html";
function Form({ theme }) {
const [editor] = useLexicalComposerContext();
const onSubmit = useCallback(
(e) => {
editor.update(() => {
const tmp = $generateHtmlFromNodes(editor);
console.log(tmp);
});
},
[editor]
);
return (
{}}
draggable={true}
dragMainText="Click to upload the file or drag and drop the file here"
dragSubText="Support json"
accept="application/json,.ddb"
onRemove={() => {}}
onFileChange={() => {}}
limit={5}
>
);
}
export default function BugReport() {
const [theme, setTheme] = useState("");
useEffect(() => {
const t = localStorage.getItem("theme");
setTheme(t);
if (t === "dark") {
const body = document.body;
if (body.hasAttribute("theme-mode")) {
body.setAttribute("theme-mode", "dark");
}
} else {
const body = document.body;
if (body.hasAttribute("theme-mode")) {
body.setAttribute("theme-mode", "light");
}
}
document.title = "Report a bug - drawDB";
document.body.setAttribute("class", "theme");
}, [setTheme]);
const changeTheme = () => {
const body = document.body;
const t = body.getAttribute("theme-mode");
if (t === "dark") {
if (body.hasAttribute("theme-mode")) {
body.setAttribute("theme-mode", "light");
setTheme("light");
}
} else {
if (body.hasAttribute("theme-mode")) {
body.setAttribute("theme-mode", "dark");
setTheme("dark");
}
}
};
return (
<>
We value your feedback! If you've encountered a bug or issue
while using our platform, please help us improve by reporting
it. Your input is invaluable in making our service better.