"use client";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import Button from "jt-design-system/es/button";
import css from "./editable-map.module.css";
export default function MarkerPopup({ marker }) {
    const { title, image, description, url, label } = marker;
    const link = url?.trim();
    const isExternal = /^https?:\/\//.test(link || "");
    return (_jsxs("div", { className: css.popup, children: [image && _jsx("img", { className: css.popupImage, src: image, alt: "" }), _jsxs("div", { className: css.popupInner, children: [_jsx("div", { className: css.popupTitle, children: title }), description && _jsx("p", { className: css.popupDescription, children: description }), link && (_jsx(Button, { tag: "a", href: link, className: css.popupLink, target: isExternal ? "_blank" : undefined, rel: isExternal ? "noopener noreferrer" : undefined, children: label || "En savoir plus" }))] })] }));
}
