import {Input} from "@/components/Input/Input";
import {useState} from "react";
import Button from "@/components/Button/Button";

export default function Transmission({ initialData }: any) {
    const [formData, setFormData] = useState({
        id: initialData?.id || null,
        type: initialData?.type || "",
    });

    const handleChange = (e: any) => {
        const { name, value } = e.target;
        setFormData({
            ...formData,
            [name]: value
        });
    };

    const handleSubmit = () => {
        console.log("Collected Data:", formData);
    };

    return (
        <>
            <Input value={formData.type} onChange={handleChange} name="type">Название</Input>
            <Button onClickAction={handleSubmit}>Сохранить</Button>
        </>
    );
}
