"use client"; import { Accordion, ActionIcon, SegmentedControl, Textarea, } from "@mantine/core"; import { useForm } from "@mantine/form"; import { IconArrowDownRight, IconMinus, IconPlus, IconRotateClockwise, } from "@tabler/icons-react"; import React, { useEffect } from "react"; import useDebounce from "../hooks/debounce"; import FieldSet from "./FieldSet"; import Label from "./Label"; import SelectInput from "./SelectInput"; import SlideInput from "./SliderInput"; import TextInput from "./TextInput"; export const Controls = React.memo(() => { const form = useForm({ initialValues: { positivePrompt: "some kind of prompt", negativePrompt: "bad hands", steps: 1, guidance: 0.1, seed: 45678, resolution: "720", }, }); const debounce = useDebounce(); const handleChange = (event) => { console.log(event); }; useEffect(() => { if (!form) return; form.isDirty() && debounce(() => handleChange(form.values), 500); }, [form, debounce]); return (