import { useEffect, useState } from "react"; // react-hook-form import { useForm } from "react-hook-form"; // ui import { Input, PrimaryButton, SecondaryButton } from "components/ui"; const defaultValues = { palette: "", }; export const ThemeForm: React.FC = ({ handleFormSubmit, handleClose, status, data }) => { const { register, formState: { errors, isSubmitting }, handleSubmit, reset, } = useForm({ defaultValues, }); const [darkPalette, setDarkPalette] = useState(false); const handleUpdateTheme = async (formData: any) => { await handleFormSubmit({ ...formData, darkPalette }); reset({ ...defaultValues, }); }; useEffect(() => { reset({ ...defaultValues, ...data, }); }, [data, reset]); // --color-bg-base: 25, 27, 27; // --color-bg-surface-1: 31, 32, 35; // --color-bg-surface-2: 39, 42, 45; // --color-border: 46, 50, 52; // --color-bg-sidebar: 19, 20, 22; // --color-accent: 60, 133, 217; // --color-text-base: 255, 255, 255; // --color-text-secondary: 142, 148, 146; return (

Customize your theme

setDarkPalette((prevData) => !prevData)} > Dark palette
Cancel {status ? isSubmitting ? "Updating Theme..." : "Update Theme" : isSubmitting ? "Creating Theme..." : "Set Theme"}
); };