import { useState } from "preact/hooks"; import styles from "./Panes.module.scss"; import { Localizer, Text } from "preact-i18n"; import Radio from "../../../components/ui/Radio"; import Button from "../../../components/ui/Button"; import InputBox from "../../../components/ui/InputBox"; import TextArea from "../../../components/ui/TextArea"; import { useSelf } from "../../../context/revoltjs/hooks"; 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 } />