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

var _templateObject, _templateObject2, _templateObject3, _templateObject4;

import React from 'react';
import styled from 'styled-components';
import { Navigation, AccountSettings, Subscriptions, Notifications, CompanyDetails, Vouchers, AddressBook, LoyaltyProgram, OrderHistory } from './Components';
import { useProfileState } from './profile.context';
import { LocalLabelsProvider, useAuthGuard } from '@sentecacommerce-theme/lib';
var componentsMap = {
  subscriptions: /*#__PURE__*/React.createElement(Subscriptions, null),
  'personal-info': /*#__PURE__*/React.createElement(AccountSettings, null),
  notifications: /*#__PURE__*/React.createElement(Notifications, null),
  vouchers: /*#__PURE__*/React.createElement(Vouchers, null),
  'company-details': /*#__PURE__*/React.createElement(CompanyDetails, null),
  'address-book': /*#__PURE__*/React.createElement(AddressBook, null),
  'loyalty-program': /*#__PURE__*/React.createElement(LoyaltyProgram, null),
  'order-history': /*#__PURE__*/React.createElement(OrderHistory, null)
};
export var Profile = props => {
  var {
    navigation
  } = props;
  var {
    profileTab
  } = useProfileState();
  var {
    isLoggedIn
  } = useAuthGuard();
  if (!isLoggedIn) return null;
  return /*#__PURE__*/React.createElement(LocalLabelsProvider, {
    labels: props.labels
  }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Inner, null, /*#__PURE__*/React.createElement(NavigationAside, {
    isVisible: !Boolean(profileTab)
  }, /*#__PURE__*/React.createElement(Navigation, {
    data: navigation
  })), /*#__PURE__*/React.createElement(TabContent, null, componentsMap[profileTab]))));
};
var Container = styled.div.attrs({
  className: 'pt-3 mt-lg-4 px-3 px-lg-5 mx-auto'
})(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n  max-width: 1440px;\n"])));
var Inner = styled.div.attrs({
  className: 'row'
})(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose([""])));
var NavigationAside = styled.aside.attrs(props => ({
  className: "col-12 col-lg-3 " + (props.isVisible ? 'd-block' : 'd-none') + " d-lg-block"
}))(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose([""])));
var TabContent = styled.div.attrs({
  className: 'col-lg-9 px-0 px-lg-auto'
})(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose([""])));
//# sourceMappingURL=profile.component.js.map