import { __assign } from '../../../node_modules/tslib/tslib.es6.js';
import React from 'react';
import { useI18n } from '../../../utilities/i18nInit.js';
import { Text } from '@chakra-ui/react';
import Link from '../../link/index.js';

var FooterLink = function (_a) {
    var _b, _c;
    var linkInstance = _a.linkInstance, children = _a.children, _d = _a.bold, bold = _d === void 0 ? false : _d;
    var _e = useI18n(), t = _e.t, language = _e.language;
    var boldStyles = bold
        ? {
            fontWeight: 'bold',
        }
        : {};
    if (!linkInstance) {
        return null;
    }
    if (!((_b = linkInstance.link) === null || _b === void 0 ? void 0 : _b[language]) && !linkInstance.onClick) {
        return (React.createElement(Text, __assign({}, boldStyles), linkInstance.translationKey && t(linkInstance.translationKey)));
    }
    if (linkInstance.onClick) {
        return (React.createElement(Link, __assign({ type: "button", as: "button", variant: "footerLink", textStyle: "body-small", onClick: linkInstance.onClick }, boldStyles), linkInstance.translationKey && t(linkInstance.translationKey)));
    }
    var targetSettings = linkInstance.target
        ? {
            target: linkInstance.target,
            rel: 'noopener noreferrer',
        }
        : {};
    return (React.createElement(Link, __assign({ href: (_c = linkInstance.link) === null || _c === void 0 ? void 0 : _c[language], variant: "footerLink", textStyle: "body-small" }, targetSettings, boldStyles), children
        ? children
        : linkInstance.translationKey && t(linkInstance.translationKey)));
};

export { FooterLink as default };
//# sourceMappingURL=Link.js.map
