"use client";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import Button from "jt-design-system/es/button";
import Input from "jt-design-system/es/input";
import css from "./editable-map.module.css";
export default function InitialMarkerForm({ onSubmit }) {
    const handleSubmit = (event) => {
        event.preventDefault();
        const data = new FormData(event.currentTarget);
        const lat = Number(data.get("latitude"));
        const lng = Number(data.get("longitude"));
        if (Number.isNaN(lat) || Number.isNaN(lng)) {
            return;
        }
        onSubmit([lat, lng]);
    };
    return (_jsxs("form", { className: css.initialForm, onSubmit: handleSubmit, children: [_jsx("div", { className: css.initialFormTitle, children: "Ajouter un point d'int\u00E9r\u00EAt" }), _jsx(Input, { name: "latitude", label: "Latitude", type: "number", step: "any", placeholder: "48.132", compact: true, required: true }), _jsx(Input, { name: "longitude", label: "Longitude", type: "number", step: "any", placeholder: "3.524", compact: true, required: true }), _jsx(Button, { type: "submit", variant: "success", className: css.initialFormButton, compact: true, children: "Confirmer" })] }));
}
