import styles from "./Panes.module.scss"; import { Localizer, Text } from "preact-i18n"; import { useState } from "preact/hooks"; import { useClient } from "../../../context/revoltjs/RevoltClient"; 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 client = useClient(); 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: client.user!.username, }), mode: "no-cors", }); setState("sent"); setChecked("Bug"); setDescription(""); setOther(""); } return (

setChecked("Bug")}> setChecked("Feature Request")}> setChecked("__other_option__")}> setOther(e.currentTarget.value)} placeholder={ ( ) as any } />