import { useState } from "preact/hooks"; import { URL } from "utils"; export default function PresetCreator({ conv, name, setName, fg, setFg, bg, setBg, font, setFont, onsubmit, }: { conv: string; name: string; setName: (_: string) => void; fg: string; setFg: (_: string) => void; bg: string; setBg: (_: string) => void; font: string; setFont: (_: string) => void; onsubmit?: () => void; }) { async function submit() { await fetch(`${URL}/api/conv/${conv}`, { method: "PUT", body: JSON.stringify({ register_preset: name, fg, bg, font }), }); } return (