"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const link_1 = __importDefault(require("next/link"));
const path_1 = require("path");
const A_1 = __importDefault(require("components/misc/A"));
function getAnchorTagComponent({ id, relativePath }) {
    return function AnchorTagComponent({ href, title, children }) {
        if (href?.includes("://")) {
            return ((0, jsx_runtime_1.jsx)(A_1.default, { href: href, title: title, children: children }));
        }
        else {
            return ((0, jsx_runtime_1.jsx)(link_1.default, { href: `/share/public_paths/${id}/${href ? encodeURIComponent((0, path_1.join)(relativePath, href)) : ""}`, children: (0, jsx_runtime_1.jsx)("a", { title: title, children: children }) }));
        }
    };
}
exports.default = getAnchorTagComponent;
//# sourceMappingURL=anchor-tag-component.js.map