Files
nodeMap/components/CoordinateModal.js
2025-01-17 19:13:29 +01:00

30 lines
946 B
JavaScript

// 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;