Modal wird angezeigt, aber muss noch angepasst werden
This commit is contained in:
29
components/CoordinateModal.js
Normal file
29
components/CoordinateModal.js
Normal file
@@ -0,0 +1,29 @@
|
||||
// components/CoordinateModal.js
|
||||
import React from "react";
|
||||
|
||||
const CoordinateModal = ({ isOpen, onClose, coordinates }) => {
|
||||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 bg-black bg-opacity-50 flex justify-center items-center z-50">
|
||||
<div className="bg-white p-6 rounded-lg shadow-lg w-80">
|
||||
<h2 className="text-lg font-bold mb-2">Koordinaten</h2>
|
||||
<p className="mb-4">Koordinaten: {coordinates}</p>
|
||||
<button
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(coordinates);
|
||||
alert("Koordinaten kopiert!");
|
||||
}}
|
||||
className="bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600"
|
||||
>
|
||||
Kopieren
|
||||
</button>
|
||||
<button onClick={onClose} className="mt-2 bg-gray-300 text-black px-4 py-2 rounded hover:bg-gray-400">
|
||||
Schließen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default CoordinateModal;
|
||||
Reference in New Issue
Block a user