import { useFormState } from "react-use-form-state"; import { Flex } from "rebass/styled-components"; import React, { useState } from "react"; import axios from "axios"; import Text, { H2, Span } from "../components/Text"; import AppWrapper from "../components/AppWrapper"; import { TextInput } from "../components/Input"; import { Button } from "../components/Button"; import { Col } from "../components/Layout"; import Icon from "../components/Icon"; import { useMessage } from "../hooks"; import { APIv2 } from "../consts"; import getConfig from "next/config"; const { publicRuntimeConfig } = getConfig(); const ReportPage = () => { const [formState, { text }] = useFormState<{ url: string }>(); const [loading, setLoading] = useState(false); const [message, setMessage] = useMessage(5000); const onSubmit = async (e) => { e.preventDefault(); setLoading(true); setMessage(); try { await axios.post(`${APIv2.Links}/report`, { link: formState.values.url }); setMessage("Thanks for the report, we'll take actions shortly.", "green"); formState.clear(); } catch (error) { setMessage(error?.response?.data?.error || "Couldn't send report."); } setLoading(false); }; return (

Report abuse

Report abuses, malware and phishing links to the below email address or use the form. We will take actions shortly. {(publicRuntimeConfig.REPORT_EMAIL || "").replace("@", "[at]")} URL containing malware/scam: {message.text}
); }; export default ReportPage;