import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose";

var _templateObject, _templateObject2, _templateObject3, _templateObject4;

import React from 'react';
import styled from 'styled-components';
import { useConfigState } from '@sentecacommerce-theme/lib';
import { Typography } from '../../../../../Common';
import { formatDeliveryHTML } from './utils';
export var Content = (_ref) => {
  var {
    activeTab,
    setActiveTab,
    labels,
    content
  } = _ref;
  var {
    palette
  } = useConfigState().theme;
  return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(TabContainers, null, /*#__PURE__*/React.createElement(Title, {
    isActive: activeTab === 'Details',
    onClick: () => setActiveTab('Details')
  }, labels.productDescription), /*#__PURE__*/React.createElement(Title, {
    isActive: activeTab === 'Delivery',
    onClick: () => setActiveTab('Delivery')
  }, labels.deliveryInfo.tabTitle)), /*#__PURE__*/React.createElement(ContentWrapper, null, activeTab === 'Details' && /*#__PURE__*/React.createElement(React.Fragment, null, content == null ? void 0 : content.map((info, index) => {
    var _info$content;

    return /*#__PURE__*/React.createElement("div", {
      dangerouslySetInnerHTML: {
        __html: (_info$content = info == null ? void 0 : info.content) != null ? _info$content : ''
      },
      key: "Info__" + (info.name || index)
    });
  })), activeTab === 'Delivery' && /*#__PURE__*/React.createElement("div", {
    dangerouslySetInnerHTML: {
      __html: formatDeliveryHTML({
        content: labels.deliveryInfo.content,
        linkColor: palette.danger
      })
    }
  })));
};
var Container = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteralLoose([""])));
var TabContainers = styled.div.attrs({
  className: 'mb-4 d-flex'
})(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose([""])));
var Title = styled(Typography).attrs({
  variant: 3,
  className: 'mr-3 d-none d-md-block'
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n  cursor: pointer;\n  color: ", ";\n\n  &:hover {\n    color: ", ";\n  }\n"])), props => props.isActive ? props.theme.palette.primary : props.theme.palette.hint, (_ref2) => {
  var {
    theme
  } = _ref2;
  return theme.palette.primary;
});
var ContentWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n  @media (max-width: ", ") {\n    padding: 0 2rem;\n  }\n"])), (_ref3) => {
  var {
    theme
  } = _ref3;
  return theme.breakpoints.sm.max;
});
//# sourceMappingURL=index.js.map