import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import { LocaleContext } from "../../../gravity-blocks/context/localeContext/index.js";
import { block } from "../../../utils/index.js";
import { i18n } from "./i18n/index.js";
import { unifyDataLensToObject } from "./utils.js";
import './DataLens.css';
const b = block('media-component-data-lens');
const DataLens = (props) => {
    const { dataLens } = props;
    const dataLensData = unifyDataLensToObject(dataLens);
    const locale = React.useContext(LocaleContext);
    return dataLens ? (_jsx("div", { className: b('wrap'), children: _jsx("iframe", { src: `https://datalens.yandex/${dataLensData.id}?_embedded=1&_theme=${dataLensData.theme}&_lang=${locale.lang}`, className: b('iframe'), loading: "lazy", title: i18n('iframe-title'), frameBorder: 0 }) })) : null;
};
export default DataLens;
//# sourceMappingURL=DataLens.js.map
