refactor and cleanup
This commit is contained in:
24
components/uiWidgets/CoordinateInput.js
Normal file
24
components/uiWidgets/CoordinateInput.js
Normal file
@@ -0,0 +1,24 @@
|
||||
// components/CoordinateInput.js
|
||||
import React, { useState } from "react";
|
||||
|
||||
const CoordinateInput = ({ onCoordinatesSubmit }) => {
|
||||
const [coordinates, setCoordinates] = useState("");
|
||||
|
||||
const handleSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
if (onCoordinatesSubmit) {
|
||||
onCoordinatesSubmit(coordinates);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit} className="fixed top-5 left-5 z-50 bg-white shadow-lg rounded-lg p-4 w-72">
|
||||
<input type="text" placeholder="Koordinaten eingeben (lat,lng)" value={coordinates} onChange={(e) => setCoordinates(e.target.value)} className="border p-2 rounded w-full mb-2" />
|
||||
<button type="submit" className="bg-blue-500 text-white p-2 rounded w-full hover:bg-blue-600">
|
||||
Zu Marker zoomen
|
||||
</button>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default CoordinateInput;
|
||||
Reference in New Issue
Block a user