import styles from "./Panes.module.scss"; import { Localizer, Text } from "preact-i18n"; import { useState } from "preact/hooks"; import { useSelf } from "../../../context/revoltjs/hooks"; import Button from "../../../components/ui/Button"; import InputBox from "../../../components/ui/InputBox"; import Radio from "../../../components/ui/Radio"; import TextArea from "../../../components/ui/TextArea"; export function Feedback() { const user = useSelf(); const [other, setOther] = useState(""); const [description, setDescription] = useState(""); const [state, setState] = useState<"ready" | "sending" | "sent">("ready"); const [checked, setChecked] = useState< "Bug" | "Feature Request" | "__other_option__" >("Bug"); async function onSubmit(ev: JSX.TargetedEvent) { ev.preventDefault(); setState("sending"); await fetch(`https://workers.revolt.chat/feedback`, { method: "POST", body: JSON.stringify({ checked, other, description, name: user?.username ?? "Unknown User", }), mode: "no-cors", }); setState("sent"); setChecked("Bug"); setDescription(""); setOther(""); } return (

setChecked("Bug")}> setChecked("Feature Request")}> {(location.hostname === "vite.revolt.chat" || location.hostname === "local.revolt.chat") && ( { setChecked("__other_option__"); setOther("Revite"); }}> Issues with Revite )} setChecked("__other_option__")}> setOther(e.currentTarget.value)} placeholder={ ( ) as any } />