"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const React = tslib_1.__importStar(require("react"));
const localeContext_1 = require("../../../gravity-blocks/context/localeContext/index.js");
const utils_1 = require("../../../utils/index.js");
const i18n_1 = require("./i18n/index.js");
const utils_2 = require("./utils.js");
const b = (0, utils_1.block)('media-component-data-lens');
const DataLens = (props) => {
    const { dataLens } = props;
    const dataLensData = (0, utils_2.unifyDataLensToObject)(dataLens);
    const locale = React.useContext(localeContext_1.LocaleContext);
    return dataLens ? ((0, jsx_runtime_1.jsx)("div", { className: b('wrap'), children: (0, jsx_runtime_1.jsx)("iframe", { src: `https://datalens.yandex/${dataLensData.id}?_embedded=1&_theme=${dataLensData.theme}&_lang=${locale.lang}`, className: b('iframe'), loading: "lazy", title: (0, i18n_1.i18n)('iframe-title'), frameBorder: 0 }) })) : null;
};
exports.default = DataLens;
//# sourceMappingURL=DataLens.js.map
