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

var _templateObject, _templateObject2, _templateObject3, _templateObject4;

import React from 'react';
import styled from 'styled-components';
import { viewsApi } from '@sentecacommerce-theme/lib';
import { PromotionsList } from './Components/PromotionsList';
import { Loader, Typography } from '../Common';
export var PromotionsPage = (_ref) => {
  var {
    labels
  } = _ref;
  var {
    data,
    isLoading
  } = viewsApi.getByTag('promotion');
  return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Title, null, labels.title), isLoading ? /*#__PURE__*/React.createElement(CenterContainer, null, /*#__PURE__*/React.createElement(Loader, null)) : !!(data != null && data.results.length) ? /*#__PURE__*/React.createElement(PromotionsList, {
    data: data,
    labels: labels
  }) : /*#__PURE__*/React.createElement(CenterContainer, null, /*#__PURE__*/React.createElement(Text, null, labels.noPromotions)));
};
var Container = styled.div.attrs({
  className: 'container-md-fluid pb-5 pb-lg-0'
})(_templateObject || (_templateObject = _taggedTemplateLiteralLoose([""])));
var Title = styled(Typography).attrs({
  variant: '2',
  as: 'h1',
  className: 'my-4 mx-2 mx-lg-0'
})(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose([""])));
var CenterContainer = styled.div.attrs({
  className: 'd-flex justify-content-center align-items-center'
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n  min-height: calc(100vh - (20rem + 40rem));\n"])));
var Text = styled(Typography).attrs({
  variant: 'base',
  as: 'p'
})(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose([""])));
//# sourceMappingURL=promotionsPage.component.js.map