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

var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;

import React from 'react';
import styled, { css } from 'styled-components';
import { Link, useConfigState, useLocalLabels } from '@sentecacommerce-theme/lib';
import { CarouselComponent } from '../../../../Common';
export var FeaturedBrands = (_ref) => {
  var {
    brands,
    defaultBackground,
    isActive
  } = _ref;
  var {
    assetKeys
  } = useConfigState();
  var {
    seeAllBrands
  } = useLocalLabels();
  return /*#__PURE__*/React.createElement(FeaturedBrandList, null, /*#__PURE__*/React.createElement(Col, {
    className: "d-flex align-items-center "
  }, /*#__PURE__*/React.createElement(Link, {
    href: "/brands",
    passHref: true
  }, /*#__PURE__*/React.createElement(AllBrands, {
    as: "a",
    isActive: isActive
  }, seeAllBrands))), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(CarouselComponent, {
    slideWidth: "20%",
    withArrows: true,
    slides: brands,
    renderSlide: brand => {
      var _brand$assets;

      var logo = (_brand$assets = brand.assets) == null ? void 0 : _brand$assets[assetKeys.brandLogo];
      return /*#__PURE__*/React.createElement(FeaturedBrand, null, /*#__PURE__*/React.createElement(Link, {
        href: brand.slug || '/',
        passHref: true
      }, /*#__PURE__*/React.createElement("a", null, /*#__PURE__*/React.createElement("img", {
        loading: "lazy",
        src: logo,
        alt: brand.name
      }))));
    }
  })));
};
var FeaturedBrandList = styled.ol.attrs({
  className: 'd-flex align-items-stretch pt-4'
})(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n  height: 100%;\n\n  & button {\n    background: rgba(255, 255, 255, 0.7);\n    min-height: 3rem !important;\n    height: 3rem !important;\n    width: 3rem !important;\n    min-width: 3rem !important;\n    line-height: 0 !important;\n    padding: 0.5rem !important;\n\n    &:hover {\n      background: rgba(255, 255, 255, 0.8);\n    }\n  }\n\n  & button:first-child > svg {\n    margin-left: -0.3rem;\n  }\n\n  & button:last-child > svg {\n    margin-right: -0.2rem;\n  }\n\n  & button > svg {\n    width: 1.6rem !important;\n    height: 1.6rem !important;\n  }\n"])));
var FeaturedBrand = styled.li.attrs({
  className: 'd-flex align-items-center justify-content-center'
})(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n  height: 10.8rem;\n\n  & img {\n    max-width: 100%;\n    max-height: 8rem;\n    width: auto;\n    height: auto;\n    font-weight: bold;\n  }\n"])));
var AllBrands = styled.div.attrs({
  className: 'd-flex align-items-center',
  as: 'a'
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n  font-size: 1.4rem;\n  line-height: 1.4;\n  cursor: pointer;\n  color: ", ";\n  font-weight: bold;\n\n  opacity: 0;\n  transform: translateY(-1rem);\n  transition: transform 0.1s, opacity 0.1s;\n  transition-delay: 0s;\n\n  ", "\n"])), (_ref2) => {
  var {
    theme
  } = _ref2;
  return theme.palette.primary;
}, props => props.isActive && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n      opacity: 1;\n      transform: translateY(0);\n      transition: transform 0.2s ease, opacity 0.2s linear;\n      transition-delay: 0.2s;\n    "]))));
var Col = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n  height: 100%;\n  width: 20%;\n\n  &:last-of-type {\n    width: 80%;\n  }\n\n  &:first-of-type {\n    font-weight: 700;\n  }\n"])));
//# sourceMappingURL=index.js.map