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

var _templateObject, _templateObject2, _templateObject3;

import React from 'react';
import styled from 'styled-components';
import { useStoresContext } from '../../stores.context';
import { ScrollView } from '../../../Common/ScrollView';
import { useStrings } from '@sentecacommerce-theme/lib';
export var StoreList = (_ref) => {
  var {
    renderStore
  } = _ref;
  var {
    stores
  } = useStoresContext();
  var labels = useStrings('stores');
  return /*#__PURE__*/React.createElement(ScrollView, {
    maxHeight: "52rem"
  }, /*#__PURE__*/React.createElement(List, null, stores.length ? stores.map(store => /*#__PURE__*/React.createElement(ListItem, {
    id: "Store_" + store.latitude + "x" + store.longitude,
    key: "Store_" + store.latitude + "-" + store.longitude
  }, renderStore(store))) : /*#__PURE__*/React.createElement(NoStoresFound, null, labels.noStoresFoundLabel)));
};
var List = styled.ul(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n  max-height: 52rem;\n  width: 100%;\n\n  border-top: 1px solid ", ";\n"])), (_ref2) => {
  var {
    theme
  } = _ref2;
  return theme.palette.grey;
});
var ListItem = styled.li(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n  cursor: pointer;\n\n  border-bottom: 0.1rem solid ", ";\n"])), (_ref3) => {
  var {
    theme
  } = _ref3;
  return theme.palette.grey;
});
var NoStoresFound = styled.li.attrs({
  className: 'mt-1'
})(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose([""])));
//# sourceMappingURL=index.js.map