import { useEffect, useRef } from "react"; import { sendToBackground } from "@plasmohq/messaging"; import useForm from "~hooks/useForm"; import Tab from "~components/ui/tab"; import Form from "~components/ui/form"; import { add } from "~components/ui/message/utils"; interface FormValue { content: string; author: string; origin: string; links: string; is_comment: boolean; } const submitForm = (body: FormValue) => { sendToBackground({ name: "say", body: { action: "addSay", values: body, }, }).then((res) => { add({ content: res.msg, }); }).catch((e) => { if (e instanceof Error) { add({ content: e.message, }); } }); } function Say() { const formRef = useRef(); const { bindInput, onSubmit } = useForm({ initialValues: { is_comment: true, }, }); return (
); } export default Say;