s-platform-landing-section 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ require('slick-carousel/slick/slick-theme.css');
21
21
  var ai = require('react-icons/ai');
22
22
  var go = require('react-icons/go');
23
23
  var ri = require('react-icons/ri');
24
+ var gi = require('react-icons/gi');
24
25
 
25
26
  var Button = function Button(props) {
26
27
  var _props$label = props.label,
@@ -111,18 +112,19 @@ var getDurationValue = function getDurationValue(attributes) {
111
112
  return durationAtt ? ((durationAtt === null || durationAtt === void 0 ? void 0 : (_durationAtt$value = durationAtt.value) === null || _durationAtt$value === void 0 ? void 0 : _durationAtt$value[0]) || "0") + " p" : "";
112
113
  };
113
114
  var genProductSlug = function genProductSlug(productName, id) {
115
+ var _slug, _slug2, _slug3, _slug4, _slug5, _slug6, _slug7, _slug8, _slug9, _slug10, _slug11;
114
116
  var slug = productName === null || productName === void 0 ? void 0 : productName.toLowerCase();
115
- slug = slug.replace(/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/g, "a");
116
- slug = slug.replace(/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/g, "e");
117
- slug = slug.replace(/(ì|í|ị|ỉ|ĩ)/g, "i");
118
- slug = slug.replace(/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/g, "o");
119
- slug = slug.replace(/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/g, "u");
120
- slug = slug.replace(/(ỳ|ý|ỵ|ỷ|ỹ)/g, "y");
121
- slug = slug.replace(/(đ)/g, "d");
122
- slug = slug.replace(/([^0-9a-z-\s])/g, "");
123
- slug = slug.replace(/(\s+)/g, "-");
124
- slug = slug.replace(/^-+/g, "");
125
- slug = slug.replace(/-+$/g, "");
117
+ slug = (_slug = slug) === null || _slug === void 0 ? void 0 : _slug.replace(/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/g, "a");
118
+ slug = (_slug2 = slug) === null || _slug2 === void 0 ? void 0 : _slug2.replace(/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/g, "e");
119
+ slug = (_slug3 = slug) === null || _slug3 === void 0 ? void 0 : _slug3.replace(/(ì|í|ị|ỉ|ĩ)/g, "i");
120
+ slug = (_slug4 = slug) === null || _slug4 === void 0 ? void 0 : _slug4.replace(/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/g, "o");
121
+ slug = (_slug5 = slug) === null || _slug5 === void 0 ? void 0 : _slug5.replace(/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/g, "u");
122
+ slug = (_slug6 = slug) === null || _slug6 === void 0 ? void 0 : _slug6.replace(/(ỳ|ý|ỵ|ỷ|ỹ)/g, "y");
123
+ slug = (_slug7 = slug) === null || _slug7 === void 0 ? void 0 : _slug7.replace(/(đ)/g, "d");
124
+ slug = (_slug8 = slug) === null || _slug8 === void 0 ? void 0 : _slug8.replace(/([^0-9a-z-\s])/g, "");
125
+ slug = (_slug9 = slug) === null || _slug9 === void 0 ? void 0 : _slug9.replace(/(\s+)/g, "-");
126
+ slug = (_slug10 = slug) === null || _slug10 === void 0 ? void 0 : _slug10.replace(/^-+/g, "");
127
+ slug = (_slug11 = slug) === null || _slug11 === void 0 ? void 0 : _slug11.replace(/-+$/g, "");
126
128
  return slug + "-" + id;
127
129
  };
128
130
  var getLinkProductDetail = function getLinkProductDetail(product) {
@@ -133,6 +135,13 @@ var getLinkServiceDetail = function getLinkServiceDetail(product) {
133
135
  var slug = genProductSlug(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
134
136
  return "/service/" + slug + "/" + (product === null || product === void 0 ? void 0 : product.shopId);
135
137
  };
138
+ var getLinkNewsDetail = function getLinkNewsDetail(news) {
139
+ var slug = genProductSlug(news === null || news === void 0 ? void 0 : news.title, news === null || news === void 0 ? void 0 : news.articleId);
140
+ return "/news_detail/" + slug + "/" + (news === null || news === void 0 ? void 0 : news.catId) + "/" + (news === null || news === void 0 ? void 0 : news.shopId);
141
+ };
142
+ var getLinkNewsByCategory = function getLinkNewsByCategory(news) {
143
+ return "/news_by_category/" + (news === null || news === void 0 ? void 0 : news.catId) + "/" + (news === null || news === void 0 ? void 0 : news.shopId);
144
+ };
136
145
  var LinkToPage = function LinkToPage(props) {
137
146
  var _props$Link = props.Link,
138
147
  Link = _props$Link === void 0 ? null : _props$Link,
@@ -875,12 +884,15 @@ var Hero1 = function Hero1(props) {
875
884
  }, /*#__PURE__*/React__default.createElement("div", {
876
885
  className: "w-[80%] md:w-2/3 xl:w-1/2 md:h-2/3 flex flex-col gap-2 md:gap-8 justify-center items-center bg-background opacity-90 absolute top-5 md:top-10 px-6 py-4 rounded-tr-[40px] rounded-bl-[40px] md:rounded-tr-[80px] md:rounded-bl-[80px]"
877
886
  }, /*#__PURE__*/React__default.createElement("div", {
878
- className: "text-xl text-center md:text-4xl lg:text-[40px] text-primary font-medium"
887
+ className: "text-xl text-center md:text-4xl lg:text-[40px] text-primary font-medium ",
888
+ style: {
889
+ lineHeight: "normal"
890
+ }
879
891
  }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : _sectionData$2.title), /*#__PURE__*/React__default.createElement("div", {
880
892
  className: "text-center md:text-2xl lg:text-3xl font-medium"
881
893
  }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$3 = sectionData[0]) === null || _sectionData$3 === void 0 ? void 0 : _sectionData$3.description), /*#__PURE__*/React__default.createElement(LinkToPage, {
882
894
  Link: Link,
883
- href: (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$4 = sectionData[0]) === null || _sectionData$4 === void 0 ? void 0 : (_sectionData$4$button = _sectionData$4.buttons) === null || _sectionData$4$button === void 0 ? void 0 : (_sectionData$4$button2 = _sectionData$4$button[0]) === null || _sectionData$4$button2 === void 0 ? void 0 : _sectionData$4$button2.route) || (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$5 = sectionData[0]) === null || _sectionData$5 === void 0 ? void 0 : (_sectionData$5$button = _sectionData$5.buttons) === null || _sectionData$5$button === void 0 ? void 0 : (_sectionData$5$button2 = _sectionData$5$button[0]) === null || _sectionData$5$button2 === void 0 ? void 0 : _sectionData$5$button2.link)
895
+ href: (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$4 = sectionData[0]) === null || _sectionData$4 === void 0 ? void 0 : (_sectionData$4$button = _sectionData$4.buttons) === null || _sectionData$4$button === void 0 ? void 0 : (_sectionData$4$button2 = _sectionData$4$button[0]) === null || _sectionData$4$button2 === void 0 ? void 0 : _sectionData$4$button2.route) || (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$5 = sectionData[0]) === null || _sectionData$5 === void 0 ? void 0 : (_sectionData$5$button = _sectionData$5.buttons) === null || _sectionData$5$button === void 0 ? void 0 : (_sectionData$5$button2 = _sectionData$5$button[0]) === null || _sectionData$5$button2 === void 0 ? void 0 : _sectionData$5$button2.link) || "#"
884
896
  }, /*#__PURE__*/React__default.createElement(Button, {
885
897
  label: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$6 = sectionData[0]) === null || _sectionData$6 === void 0 ? void 0 : (_sectionData$6$button = _sectionData$6.buttons) === null || _sectionData$6$button === void 0 ? void 0 : (_sectionData$6$button2 = _sectionData$6$button[0]) === null || _sectionData$6$button2 === void 0 ? void 0 : _sectionData$6$button2.label,
886
898
  shopConfigStyle: shopConfigStyle
@@ -914,7 +926,7 @@ var Hero2 = function Hero2(props) {
914
926
  className: "relative"
915
927
  }, /*#__PURE__*/React__default.createElement("img", {
916
928
  src: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : (_data$data$$srcImages = _data$data$.srcImages) === null || _data$data$$srcImages === void 0 ? void 0 : _data$data$$srcImages[0],
917
- className: "w-full object-cover min-h-[25vh] md:min-h-[30vh] max-h-[100vh]"
929
+ className: "w-full object-cover min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
918
930
  }), /*#__PURE__*/React__default.createElement("div", {
919
931
  className: "absolute flex flex-col gap-1 md:gap-4 absolute w-1/2 lg:w-1/3 top-2 sm:top-[20%] xl:top-1/4 right-[2%] lg:right-[15%]"
920
932
  }, /*#__PURE__*/React__default.createElement("img", {
@@ -934,7 +946,7 @@ var Hero5 = function Hero5(props) {
934
946
  className: "relative"
935
947
  }, /*#__PURE__*/React__default.createElement("img", {
936
948
  src: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : (_data$data$$srcImages = _data$data$.srcImages) === null || _data$data$$srcImages === void 0 ? void 0 : _data$data$$srcImages[0],
937
- className: "w-full min-h-[25vh] md:min-h-[30vh] max-h-[100vh]"
949
+ className: "w-full min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
938
950
  }), /*#__PURE__*/React__default.createElement("div", {
939
951
  className: "flex flex-col gap-2 md:gap-4 absolute top-5 md:top-[20%] w-1/2 lg:w-1/3 left-4 xl:left-20"
940
952
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -955,7 +967,7 @@ var Hero6 = function Hero6(props) {
955
967
  className: "relative"
956
968
  }, /*#__PURE__*/React__default.createElement("img", {
957
969
  src: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : (_data$data$$srcImages = _data$data$.srcImages) === null || _data$data$$srcImages === void 0 ? void 0 : _data$data$$srcImages[0],
958
- className: "w-full h-auto min-h-[25vh md:min-h-[30vh] max-h-[100vh]"
970
+ className: "w-full h-auto min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
959
971
  }), /*#__PURE__*/React__default.createElement("div", {
960
972
  className: "absolute top-0 md:top-14 lg:top-20 w-full p-3 md:p-6 lg:p-12 z-10 flex flex-col gap-2 md:gap-4 lg:gap-6 items-center justify-center"
961
973
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -976,7 +988,9 @@ var Hero6 = function Hero6(props) {
976
988
  var Hero10 = function Hero10(props) {
977
989
  var _data$data, _data$data$, _data$data$$srcImages, _sectionData$, _sectionData$2, _sectionData$2$button;
978
990
  var shopConfigStyle = props.shopConfigStyle,
979
- data = props.data;
991
+ data = props.data,
992
+ _props$Link = props.Link,
993
+ Link = _props$Link === void 0 ? null : _props$Link;
980
994
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
981
995
  return /*#__PURE__*/React__default.createElement("div", {
982
996
  className: "relative w-full bg-cover bg-center bg-no-repeat ",
@@ -989,8 +1003,10 @@ var Hero10 = function Hero10(props) {
989
1003
  className: "relative w-full min-h-[540px] p-12 z-10 flex flex-col gap-6 items-center justify-center"
990
1004
  }, /*#__PURE__*/React__default.createElement("div", {
991
1005
  className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center font-headingFont"
992
- }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.title), sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : (_sectionData$2$button = _sectionData$2.buttons) === null || _sectionData$2$button === void 0 ? void 0 : _sectionData$2$button.map(function (button) {
993
- return /*#__PURE__*/React__default.createElement("a", {
1006
+ }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.title), sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : (_sectionData$2$button = _sectionData$2.buttons) === null || _sectionData$2$button === void 0 ? void 0 : _sectionData$2$button.map(function (button, index) {
1007
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
1008
+ Link: Link,
1009
+ key: "gdf-" + index,
994
1010
  href: (button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
995
1011
  }, /*#__PURE__*/React__default.createElement(Button, {
996
1012
  label: button === null || button === void 0 ? void 0 : button.label,
@@ -7357,7 +7373,7 @@ var Features3 = function Features3(props) {
7357
7373
  }, sectionData && sectionData.length > 0 && sectionData.map(function (item, index) {
7358
7374
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
7359
7375
  Link: Link,
7360
- href: (item === null || item === void 0 ? void 0 : item.link) || (item === null || item === void 0 ? void 0 : item.route)
7376
+ href: (item === null || item === void 0 ? void 0 : item.link) || (item === null || item === void 0 ? void 0 : item.route) || "#"
7361
7377
  }, /*#__PURE__*/React__default.createElement("div", {
7362
7378
  className: "grid grid-cols-2 p-3 rounded-lg font-semibold",
7363
7379
  key: "dfsdfj-" + index,
@@ -7852,12 +7868,14 @@ var TreatmentsCategory7 = function TreatmentsCategory7(props) {
7852
7868
  }));
7853
7869
  };
7854
7870
 
7855
- var NotFoundProduct = function NotFoundProduct() {
7871
+ var NotFoundProduct = function NotFoundProduct(props) {
7872
+ var _props$text = props.text,
7873
+ text = _props$text === void 0 ? "sản phẩm" : _props$text;
7856
7874
  return /*#__PURE__*/React__default.createElement("div", {
7857
7875
  className: "h-60 flex flex-col justify-center items-center text-xl text-gray3"
7858
7876
  }, /*#__PURE__*/React__default.createElement(fa.FaBoxOpen, {
7859
7877
  size: 80
7860
- }), /*#__PURE__*/React__default.createElement("div", null, "Kh\xF4ng c\xF3 s\u1EA3n ph\u1EA9m"));
7878
+ }), /*#__PURE__*/React__default.createElement("div", null, "Kh\xF4ng c\xF3 ", text));
7861
7879
  };
7862
7880
 
7863
7881
  var TreatmentsList6 = function TreatmentsList6(props) {
@@ -7922,28 +7940,34 @@ var ModalNotification = function ModalNotification(props) {
7922
7940
  var onClose = props.onClose,
7923
7941
  onCloseFormBooking = props.onCloseFormBooking,
7924
7942
  _props$isButtonClose = props.isButtonClose,
7925
- isButtonClose = _props$isButtonClose === void 0 ? true : _props$isButtonClose;
7943
+ isButtonClose = _props$isButtonClose === void 0 ? true : _props$isButtonClose,
7944
+ _props$className = props.className,
7945
+ className = _props$className === void 0 ? "" : _props$className,
7946
+ _props$style = props.style,
7947
+ style = _props$style === void 0 ? {} : _props$style,
7948
+ _props$buttonClassNam = props.buttonClassName,
7949
+ buttonClassName = _props$buttonClassNam === void 0 ? "" : _props$buttonClassNam;
7926
7950
  var handleClickOutside = function handleClickOutside(event) {
7927
- if (modalRef.current && !modalRef.current.contains(event.target)) {
7928
- if (onClose) onClose();
7929
- if (onCloseFormBooking && typeof onCloseFormBooking === 'function') {
7930
- onCloseFormBooking();
7931
- }
7951
+ event.stopPropagation();
7952
+ if (onClose) {
7953
+ onClose === null || onClose === void 0 ? void 0 : onClose();
7954
+ }
7955
+ if (onCloseFormBooking && typeof onCloseFormBooking === 'function') {
7956
+ onCloseFormBooking();
7932
7957
  }
7933
7958
  };
7934
- React.useEffect(function () {
7935
- document.addEventListener('click', handleClickOutside);
7936
- return function () {
7937
- document.removeEventListener('click', handleClickOutside);
7938
- };
7939
- }, []);
7940
7959
  return /*#__PURE__*/React__default.createElement("div", {
7941
- className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 "
7960
+ className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 ",
7961
+ onClick: handleClickOutside
7942
7962
  }, /*#__PURE__*/React__default.createElement("div", {
7943
- className: " flex items-center justify-center relative bg-red",
7963
+ className: "flex items-center justify-center relative " + className,
7964
+ onClick: function onClick(e) {
7965
+ return e.stopPropagation();
7966
+ },
7967
+ style: style,
7944
7968
  ref: modalRef
7945
7969
  }, props === null || props === void 0 ? void 0 : props.children, isButtonClose && /*#__PURE__*/React__default.createElement("button", {
7946
- className: "absolute top-4 right-4",
7970
+ className: "absolute top-4 right-4 " + buttonClassName,
7947
7971
  onClick: onClose
7948
7972
  }, /*#__PURE__*/React__default.createElement(rx.RxCross2, null))));
7949
7973
  };
@@ -8114,6 +8138,14 @@ var Select = React.forwardRef(function (props, ref) {
8114
8138
  setListOptions(options);
8115
8139
  if (!isMulti) setValue(defaultValue);
8116
8140
  }, [options]);
8141
+ React.useEffect(function () {
8142
+ var delayDebounceFn = setTimeout(function () {
8143
+ handleSearch === null || handleSearch === void 0 ? void 0 : handleSearch(inputSearch);
8144
+ }, 500);
8145
+ return function () {
8146
+ return clearTimeout(delayDebounceFn);
8147
+ };
8148
+ }, [inputSearch]);
8117
8149
  React.useEffect(function () {
8118
8150
  var _inputRef$current;
8119
8151
  inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
@@ -8190,11 +8222,9 @@ var Select = React.forwardRef(function (props, ref) {
8190
8222
  return true;
8191
8223
  }
8192
8224
  };
8193
- var handleSearch = function handleSearch(e) {
8194
- var searchValue = e.target.value;
8195
- setInputSearch(searchValue);
8225
+ var handleSearch = function handleSearch(searchValue) {
8196
8226
  if (handleSearchOption && typeof handleSearchOption === 'function') {
8197
- handleSearchOption(searchValue);
8227
+ handleSearchOption === null || handleSearchOption === void 0 ? void 0 : handleSearchOption(searchValue);
8198
8228
  } else {
8199
8229
  var listFilterOptions = options.filter(function (item) {
8200
8230
  var _item$label;
@@ -8282,7 +8312,7 @@ var Select = React.forwardRef(function (props, ref) {
8282
8312
  placeholder: "T\xECm ki\u1EBFm",
8283
8313
  value: inputSearch,
8284
8314
  onChange: function onChange(e) {
8285
- handleSearch(e);
8315
+ setInputSearch(e.target.value);
8286
8316
  }
8287
8317
  })) : null, /*#__PURE__*/React__default.createElement("div", null, (listOptions === null || listOptions === void 0 ? void 0 : listOptions.length) > 0 ? listOptions === null || listOptions === void 0 ? void 0 : listOptions.map(function (item, index) {
8288
8318
  return /*#__PURE__*/React__default.createElement("div", {
@@ -9077,9 +9107,10 @@ var TreatmentsList7 = function TreatmentsList7(props) {
9077
9107
  var renderItemSlide = function renderItemSlide(product, index) {
9078
9108
  var _product$productInfo, _product$productInfo2;
9079
9109
  return /*#__PURE__*/React__default.createElement("div", {
9080
- className: "w-full"
9110
+ className: "w-full",
9111
+ key: "shshf-" + index
9081
9112
  }, /*#__PURE__*/React__default.createElement("div", {
9082
- className: "grid grid-cols-1 md:grid-cols-2 gap-6 mt-12",
9113
+ className: "grid grid-cols-1 md:grid-cols-2 gap-6",
9083
9114
  key: index
9084
9115
  }, /*#__PURE__*/React__default.createElement(ProductImage, {
9085
9116
  product: product === null || product === void 0 ? void 0 : product.productInfo,
@@ -9102,33 +9133,22 @@ var TreatmentsList7 = function TreatmentsList7(props) {
9102
9133
  }
9103
9134
  }))));
9104
9135
  };
9105
- function RenderArrow(props) {
9106
- var className = props.className,
9107
- style = props.style,
9108
- onClick = props.onClick;
9109
- return /*#__PURE__*/React__default.createElement("div", {
9110
- className: className,
9111
- style: _extends({}, style, {
9112
- display: "none"
9113
- }),
9114
- onClick: onClick
9115
- });
9116
- }
9117
9136
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9118
9137
  className: "" + SECTION_DEFAULT_CLASS
9119
9138
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9120
9139
  data: data,
9121
9140
  shopConfigStyle: shopConfigStyle
9122
- }), /*#__PURE__*/React__default.createElement(Slider, {
9123
- className: "center",
9141
+ }), /*#__PURE__*/React__default.createElement("div", {
9142
+ className: "mt-12 w-full"
9143
+ }, (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement(Slider, {
9124
9144
  infinite: true,
9125
9145
  slidesToShow: 1,
9146
+ slidesToScroll: 1,
9126
9147
  speed: 500,
9127
9148
  autoplay: true,
9128
9149
  autoplaySpeed: 4000,
9129
9150
  pauseOnHover: true,
9130
- nextArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
9131
- prevArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
9151
+ arrows: false,
9132
9152
  beforeChange: function beforeChange(oldIndex, newIndex) {
9133
9153
  return setCurrentSlide(newIndex);
9134
9154
  },
@@ -9142,6 +9162,8 @@ var TreatmentsList7 = function TreatmentsList7(props) {
9142
9162
  }
9143
9163
  }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9144
9164
  return renderItemSlide(product, index);
9165
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, {
9166
+ text: "d\u1ECBch v\u1EE5"
9145
9167
  }))), /*#__PURE__*/React__default.createElement(Dash, {
9146
9168
  color: secondary
9147
9169
  }), isOpenModal ? /*#__PURE__*/React__default.createElement(ModalNotification, {
@@ -10671,7 +10693,7 @@ var BookingForm6 = function BookingForm6(props) {
10671
10693
  }), /*#__PURE__*/React__default.createElement("div", {
10672
10694
  className: "mt-12 grid grid-cols-1 gap-6 md:grid-cols-3 md:gap-12"
10673
10695
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
10674
- href: (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : _data$data$.route) || (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.link)
10696
+ href: (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : _data$data$.route) || (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.link) || "#"
10675
10697
  }, data !== null && data !== void 0 && (_data$data3 = data.data) !== null && _data$data3 !== void 0 && (_data$data3$ = _data$data3[0]) !== null && _data$data3$ !== void 0 && _data$data3$.svgImage ? /*#__PURE__*/React__default.createElement("div", {
10676
10698
  className: "text-primary w-full h-auto"
10677
10699
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -10789,7 +10811,7 @@ var Banner3 = function Banner3(props) {
10789
10811
  }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
10790
10812
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
10791
10813
  Link: Link,
10792
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link),
10814
+ href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#",
10793
10815
  key: "djsd-" + index
10794
10816
  }, /*#__PURE__*/React__default.createElement("img", {
10795
10817
  src: item === null || item === void 0 ? void 0 : item.srcImage,
@@ -11069,7 +11091,7 @@ var Footer1 = function Footer1(props) {
11069
11091
  })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (route, index) {
11070
11092
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
11071
11093
  Link: Link,
11072
- href: route === null || route === void 0 ? void 0 : route.route,
11094
+ href: (route === null || route === void 0 ? void 0 : route.route) || "#",
11073
11095
  key: "dfjg-" + index
11074
11096
  }, /*#__PURE__*/React__default.createElement("div", null, route === null || route === void 0 ? void 0 : route.label));
11075
11097
  }))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
@@ -11183,7 +11205,9 @@ var Footer7 = function Footer7(props) {
11183
11205
  }, /*#__PURE__*/React__default.createElement("div", {
11184
11206
  className: "mb-4 font-semibold text-md md:text-lg"
11185
11207
  }, "Th\xF4ng tin li\xEAn h\u1EC7"), shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
11186
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", null, "C\u01A1 s\u1EDF ", index + 1), /*#__PURE__*/React__default.createElement("div", {
11208
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
11209
+ key: "dlkhg-" + index
11210
+ }, /*#__PURE__*/React__default.createElement("div", null, "C\u01A1 s\u1EDF ", index + 1), /*#__PURE__*/React__default.createElement("div", {
11187
11211
  className: "flex gap-1"
11188
11212
  }, /*#__PURE__*/React__default.createElement(io5.IoLocationOutline, {
11189
11213
  size: 24,
@@ -11208,7 +11232,7 @@ var Footer7 = function Footer7(props) {
11208
11232
  return e === null || e === void 0 ? void 0 : e.isShow;
11209
11233
  })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (route, index) {
11210
11234
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
11211
- href: route === null || route === void 0 ? void 0 : route.route,
11235
+ href: (route === null || route === void 0 ? void 0 : route.route) || "#",
11212
11236
  Link: Link,
11213
11237
  key: "fiddf-" + index
11214
11238
  }, /*#__PURE__*/React__default.createElement("div", null, route === null || route === void 0 ? void 0 : route.label));
@@ -11331,71 +11355,48 @@ var CustomerRating1 = function CustomerRating1(props) {
11331
11355
  var CustomerRating5 = function CustomerRating5(props) {
11332
11356
  var _props$data = props.data,
11333
11357
  data = _props$data === void 0 ? {} : _props$data;
11334
- var _useState = React.useState(0),
11335
- currentIndex = _useState[0],
11336
- setCurrentIndex = _useState[1];
11337
11358
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
11338
- var _useState2 = React.useState(0),
11339
- startX = _useState2[0],
11340
- setStartX = _useState2[1];
11341
- var _useState3 = React.useState(0),
11342
- endX = _useState3[0],
11343
- setEndX = _useState3[1];
11344
- var sliderRef = React.useRef();
11345
- var handleTouchStart = function handleTouchStart(e) {
11346
- var touchStart = e.touches[0].clientX;
11347
- setStartX(touchStart);
11348
- };
11349
- var handleTouchMove = function handleTouchMove(e) {
11350
- var touchMove = e.touches[0].clientX;
11351
- setEndX(touchMove);
11352
- };
11353
- var handleTouchEnd = function handleTouchEnd() {
11354
- var diff = startX - endX;
11355
- var threshold = sliderRef.current.offsetWidth / 3;
11356
- if (diff > threshold && currentIndex < sectionData.length - 1) {
11357
- setCurrentIndex(currentIndex + 1);
11358
- } else if (diff < -threshold && currentIndex > 0) {
11359
- setCurrentIndex(currentIndex - 1);
11360
- }
11361
- };
11359
+ var _useState = React.useState(0),
11360
+ currentSlide = _useState[0],
11361
+ setCurrentSlide = _useState[1];
11362
11362
  return /*#__PURE__*/React__default.createElement("div", {
11363
11363
  className: SECTION_CLASS + " mx-0 md:mx-4 xl:mx-20 rounded-xl pb-6 relative"
11364
11364
  }, /*#__PURE__*/React__default.createElement("div", {
11365
11365
  className: "absolute mt-16 inset-0 bg-bgSecondary [clip-path:polygon(0%_0%,_100%_30%,_100%_100%,_0%_100%)] z-0 rounded-3xl"
11366
11366
  }), /*#__PURE__*/React__default.createElement("div", {
11367
- className: "w-full relative z-10 border border-textHeading rounded-3xl flex overflow-hidden",
11368
- ref: sliderRef,
11369
- onTouchStart: handleTouchStart,
11370
- onTouchMove: handleTouchMove,
11371
- onTouchEnd: handleTouchEnd
11372
- }, /*#__PURE__*/React__default.createElement("div", {
11373
- className: "flex justify-start transition-transform duration-300",
11374
- style: {
11375
- transform: "translateX(-" + currentIndex * 100 + "%)"
11367
+ className: "w-full relative z-10 border border-textHeading rounded-3xl"
11368
+ }, /*#__PURE__*/React__default.createElement(Slider, {
11369
+ infinite: true,
11370
+ slidesToShow: 1,
11371
+ slidesToScroll: 1,
11372
+ speed: 500,
11373
+ autoplay: true,
11374
+ autoplaySpeed: 4000,
11375
+ pauseOnHover: true,
11376
+ arrows: false,
11377
+ beforeChange: function beforeChange(oldIndex, newIndex) {
11378
+ return setCurrentSlide(newIndex);
11379
+ },
11380
+ dots: true,
11381
+ customPaging: function customPaging(i) {
11382
+ return i === currentSlide ? /*#__PURE__*/React__default.createElement("div", {
11383
+ className: "w-4 h-1 rounded-full bg-primary mt-4"
11384
+ }) : /*#__PURE__*/React__default.createElement("div", {
11385
+ className: "w-4 h-1 rounded-full bg-gray-300 mt-4"
11386
+ });
11376
11387
  }
11377
11388
  }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
11378
11389
  return /*#__PURE__*/React__default.createElement("div", {
11379
- className: "flex flex-col px-2 py-2 md:px-6 lg:px-12 md:py-6 items-center md:flex-row gap-6 md:gap-12 min-w-full overflow-hidden",
11390
+ className: "p-6 !flex !flex-col md:!flex-row gap-4 xl:gap-6",
11380
11391
  key: "lpky-" + index
11381
11392
  }, /*#__PURE__*/React__default.createElement("img", {
11382
11393
  src: item === null || item === void 0 ? void 0 : item.avatar,
11383
- className: "w-80 h-96 object-cover rounded-3xl"
11394
+ className: "w-full md:w-80 h-96 object-cover rounded-3xl"
11384
11395
  }), /*#__PURE__*/React__default.createElement("div", {
11385
- className: "flex flex-col items-center md:items-start gap-6 justify-center"
11396
+ className: "flex flex-col items-center md:items-start gap-4 lg:gap-6 justify-center"
11386
11397
  }, /*#__PURE__*/React__default.createElement("div", {
11387
11398
  className: "text-4xl font-semibold"
11388
- }, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.content), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.description)));
11389
- })), /*#__PURE__*/React__default.createElement("div", {
11390
- className: "absolute bottom-2 md:bottom-20 lg:bottom-[30%] left-1/2 md:left-2/3 xl:left-1/2 transform -translate-x-1/2 flex gap-2"
11391
- }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (_, index) {
11392
- return /*#__PURE__*/React__default.createElement("div", {
11393
- key: "dot-" + index,
11394
- onClick: function onClick() {
11395
- setCurrentIndex(index);
11396
- },
11397
- className: (currentIndex === index ? "w-6 bg-primary" : "w-3 bg-gray4") + " h-3 rounded-full hover:opacity-80 cursor-pointer "
11398
- });
11399
+ }, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.content), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.description, " ")));
11399
11400
  }))));
11400
11401
  };
11401
11402
 
@@ -11676,6 +11677,7 @@ var Breadcrumb1 = function Breadcrumb1(props) {
11676
11677
  label: "Trang chủ",
11677
11678
  route: "/"
11678
11679
  });
11680
+ console.log(items);
11679
11681
  setItems(items);
11680
11682
  };
11681
11683
  return /*#__PURE__*/React__default.createElement("div", {
@@ -11688,7 +11690,7 @@ var Breadcrumb1 = function Breadcrumb1(props) {
11688
11690
  className: "text-gray4"
11689
11691
  }, "/") : null, item !== null && item !== void 0 && item.route ? /*#__PURE__*/React__default.createElement(LinkToPage, {
11690
11692
  Link: Link,
11691
- href: item === null || item === void 0 ? void 0 : item.route,
11693
+ href: (item === null || item === void 0 ? void 0 : item.route) || "#",
11692
11694
  style: {
11693
11695
  color: textHeading
11694
11696
  }
@@ -12674,7 +12676,7 @@ var SearchBar2 = function SearchBar2(props) {
12674
12676
  backgroundSize: "cover"
12675
12677
  }
12676
12678
  }, /*#__PURE__*/React__default.createElement("div", {
12677
- className: "w-[100vw] md:w-[50vw] py-6 mx-auto px-6 flex flex-col h-full gap-4"
12679
+ className: "w-full md:w-1/2 py-6 mx-auto px-6 flex flex-col h-full gap-4"
12678
12680
  }, /*#__PURE__*/React__default.createElement(Input, {
12679
12681
  icons: /*#__PURE__*/React__default.createElement(io5.IoSearchOutline, {
12680
12682
  className: "text-gray3"
@@ -12727,13 +12729,14 @@ var SearchBar5 = function SearchBar5(props) {
12727
12729
  }, data !== null && data !== void 0 && (_data$data2 = data.data) !== null && _data$data2 !== void 0 && _data$data2.title ? /*#__PURE__*/React__default.createElement("div", {
12728
12730
  className: "text-xl font-semibold md:text-3xl lg:text-4xl text-textButton text-center"
12729
12731
  }, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.title) : null, data !== null && data !== void 0 && (_data$data4 = data.data) !== null && _data$data4 !== void 0 && _data$data4.description ? /*#__PURE__*/React__default.createElement("div", {
12730
- className: "text-center"
12732
+ className: "text-center text-textButton"
12731
12733
  }, data === null || data === void 0 ? void 0 : (_data$data5 = data.data) === null || _data$data5 === void 0 ? void 0 : _data$data5.description) : null, /*#__PURE__*/React__default.createElement(Input, {
12732
12734
  onChange: setValue,
12733
12735
  icons: /*#__PURE__*/React__default.createElement(io5.IoSearchOutline, {
12734
12736
  className: "text-gray3 ps-1 text-xl md:text-2xl"
12735
12737
  }),
12736
- className: "w-full bg-bgSecondary w-full md:w-[50vw] lg:w-[35vw] mb-2 md:h-12",
12738
+ wrapClassName: "w-full sm:w-[60%] md:w-[50%] lg:w-[40%]",
12739
+ className: "w-full bg-bgSecondary mb-2 md:h-12",
12737
12740
  style: {
12738
12741
  borderRadius: "32px"
12739
12742
  },
@@ -12754,8 +12757,7 @@ var SearchBar5 = function SearchBar5(props) {
12754
12757
 
12755
12758
  var SearchBar6 = function SearchBar6(props) {
12756
12759
  var _data$data, _data$data2, _data$data3, _data$data4, _data$data5;
12757
- var shopConfigStyle = props.shopConfigStyle,
12758
- _props$Link = props.Link,
12760
+ var _props$Link = props.Link,
12759
12761
  Link = _props$Link === void 0 ? null : _props$Link,
12760
12762
  data = props.data;
12761
12763
  var _useState = React.useState(""),
@@ -12771,14 +12773,15 @@ var SearchBar6 = function SearchBar6(props) {
12771
12773
  }, data !== null && data !== void 0 && (_data$data2 = data.data) !== null && _data$data2 !== void 0 && _data$data2.title ? /*#__PURE__*/React__default.createElement("div", {
12772
12774
  className: "text-lg font-semibold text-textBody md:text-2xl lg:text-3xl text-center"
12773
12775
  }, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.title) : null, data !== null && data !== void 0 && (_data$data4 = data.data) !== null && _data$data4 !== void 0 && _data$data4.description ? /*#__PURE__*/React__default.createElement("div", {
12774
- className: "text-center"
12776
+ className: "text-center text-textBody"
12775
12777
  }, data === null || data === void 0 ? void 0 : (_data$data5 = data.data) === null || _data$data5 === void 0 ? void 0 : _data$data5.description) : null, /*#__PURE__*/React__default.createElement("div", {
12776
- className: "flex gap-2 md:gap-4 lg:gap-6 mb-2 md:mb-0"
12778
+ className: "flex gap-2 md:gap-4 lg:gap-6 mb-2 md:mb-0 w-full md:w-[70%] h-10 lg:h-12 lg:w-1/2"
12777
12779
  }, /*#__PURE__*/React__default.createElement(Input, {
12778
12780
  icons: /*#__PURE__*/React__default.createElement(io5.IoSearchOutline, {
12779
12781
  className: "text-gray3"
12780
12782
  }),
12781
- className: "w-full h-full md:h-12 w-full md:w-[70vw] bg-background lg:w-[50vw]",
12783
+ className: "w-full h-full",
12784
+ wrapClassName: " w-full h-full",
12782
12785
  inputClassName: "w-full",
12783
12786
  placeholder: data !== null && data !== void 0 && data.sectionTitle ? data === null || data === void 0 ? void 0 : data.sectionTitle : "Tìm kiếm sản phẩm",
12784
12787
  onChange: setValue
@@ -12787,12 +12790,10 @@ var SearchBar6 = function SearchBar6(props) {
12787
12790
  href: genLinkSearch(value)
12788
12791
  }, /*#__PURE__*/React__default.createElement(Button, {
12789
12792
  label: "T\xECm ki\u1EBFm",
12790
- className: "whitespace-nowrap h-full",
12791
- shopConfigStyle: shopConfigStyle
12793
+ className: "whitespace-nowrap h-full"
12792
12794
  })) : /*#__PURE__*/React__default.createElement(Button, {
12793
12795
  label: "T\xECm ki\u1EBFm",
12794
- className: "whitespace-nowrap ",
12795
- shopConfigStyle: shopConfigStyle
12796
+ className: "whitespace-nowrap "
12796
12797
  }))));
12797
12798
  };
12798
12799
 
@@ -12806,7 +12807,7 @@ var ShopHighlights2 = function ShopHighlights2(props) {
12806
12807
  }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
12807
12808
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
12808
12809
  Link: Link,
12809
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link)
12810
+ href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#"
12810
12811
  }, /*#__PURE__*/React__default.createElement("div", {
12811
12812
  className: "flex flex-col items-center text-center lg:px-3 gap-3",
12812
12813
  key: "kdf-" + index
@@ -12834,7 +12835,7 @@ var ShopHighlights5 = function ShopHighlights5(props) {
12834
12835
  className: SECTION_CLASS + " grid md:grid-cols-3 py-6 gap-4 lg:gap-6 bg-bgSecondary"
12835
12836
  }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
12836
12837
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
12837
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link),
12838
+ href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#",
12838
12839
  Link: Link
12839
12840
  }, /*#__PURE__*/React__default.createElement("div", {
12840
12841
  className: "flex flex-col items-center text-center md:px-3 lg:px-6 gap-3",
@@ -12880,7 +12881,7 @@ var ShopHighlights6 = function ShopHighlights6(props) {
12880
12881
  className: " w-44 h-0.5 rounded-full bg-primary"
12881
12882
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.description), /*#__PURE__*/React__default.createElement(LinkToPage, {
12882
12883
  Link: Link,
12883
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link)
12884
+ href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#"
12884
12885
  }, /*#__PURE__*/React__default.createElement(Button, {
12885
12886
  shopConfigStyle: shopConfigStyle,
12886
12887
  label: item === null || item === void 0 ? void 0 : item.title
@@ -12908,10 +12909,9 @@ var ShopHighlights7 = function ShopHighlights7(props) {
12908
12909
  }), /*#__PURE__*/React__default.createElement("div", {
12909
12910
  className: "mt-6 grid grid-cols-3 gap-4 md:gap-8"
12910
12911
  }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
12911
- var _item, _item2;
12912
12912
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
12913
12913
  Link: Link,
12914
- href: ((_item = item) === null || _item === void 0 ? void 0 : _item.route) || ((_item2 = item) === null || _item2 === void 0 ? void 0 : _item2.link),
12914
+ href: (it === null || it === void 0 ? void 0 : it.route) || (it === null || it === void 0 ? void 0 : it.link) || "#",
12915
12915
  key: index,
12916
12916
  className: "pt-6 col-span-3 md:col-span-1"
12917
12917
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -12969,6 +12969,484 @@ var VideoFull1 = function VideoFull1(props) {
12969
12969
  })) : null);
12970
12970
  };
12971
12971
 
12972
+ var getAllArticleNewsApi = function getAllArticleNewsApi(shopId, appId, landingShopConfigId, params) {
12973
+ if (params === void 0) {
12974
+ params = {};
12975
+ }
12976
+ return api({
12977
+ method: "get",
12978
+ url: "/landing/news/article/get-all-filter",
12979
+ params: _extends({
12980
+ shopId: shopId,
12981
+ appId: appId,
12982
+ landingShopConfigId: landingShopConfigId
12983
+ }, params)
12984
+ });
12985
+ };
12986
+ var getNewsDetailApi = function getNewsDetailApi(articleId, shopId, landingShopConfigId) {
12987
+ return api({
12988
+ method: "get",
12989
+ url: "/landing/news/article/" + articleId,
12990
+ params: {
12991
+ shopId: shopId,
12992
+ landingShopConfigId: landingShopConfigId,
12993
+ articleId: articleId
12994
+ }
12995
+ });
12996
+ };
12997
+
12998
+ var NewsController = function NewsController(props) {
12999
+ var shopConfig = props.shopConfig,
13000
+ params = props.params;
13001
+ var _useState = React.useState(false),
13002
+ loading = _useState[0],
13003
+ setLoading = _useState[1];
13004
+ var _useState2 = React.useState([]),
13005
+ newsArticles = _useState2[0],
13006
+ setNewsArticles = _useState2[1];
13007
+ var _useState3 = React.useState(),
13008
+ setPage = _useState3[1];
13009
+ React.useEffect(function () {
13010
+ if (shopConfig !== null && shopConfig !== void 0 && shopConfig.shopId && shopConfig !== null && shopConfig !== void 0 && shopConfig.landingShopConfigId) {
13011
+ getAllArticleNews();
13012
+ } else {
13013
+ setNewsArticles([]);
13014
+ setPage(null);
13015
+ }
13016
+ }, [shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingShopConfigId, params]);
13017
+ var getAllArticleNews = function getAllArticleNews() {
13018
+ try {
13019
+ setLoading(true);
13020
+ var _temp = _catch(function () {
13021
+ var defaultParams = {
13022
+ page: 0,
13023
+ size: 10,
13024
+ active: true
13025
+ };
13026
+ var filterParams = _extends({}, defaultParams, params);
13027
+ return Promise.resolve(getAllArticleNewsApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.appId, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingShopConfigId, filterParams)).then(function (response) {
13028
+ var _response$data, _response$data$status;
13029
+ if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$status = _response$data.status) === null || _response$data$status === void 0 ? void 0 : _response$data$status.code) == 200) {
13030
+ var _response$data2, _response$data2$data, _response$data3, _response$data3$data;
13031
+ setNewsArticles(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$data = _response$data2.data) === null || _response$data2$data === void 0 ? void 0 : _response$data2$data.content);
13032
+ setPage(response === null || response === void 0 ? void 0 : (_response$data3 = response.data) === null || _response$data3 === void 0 ? void 0 : (_response$data3$data = _response$data3.data) === null || _response$data3$data === void 0 ? void 0 : _response$data3$data.totalElements);
13033
+ }
13034
+ setLoading(false);
13035
+ });
13036
+ }, function (error) {
13037
+ console.log(error);
13038
+ setLoading(false);
13039
+ });
13040
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
13041
+ } catch (e) {
13042
+ return Promise.reject(e);
13043
+ }
13044
+ };
13045
+ return {
13046
+ newsArticles: newsArticles,
13047
+ loading: loading
13048
+ };
13049
+ };
13050
+
13051
+ var DefaultImage$1 = function DefaultImage(props) {
13052
+ var _props$className = props.className,
13053
+ className = _props$className === void 0 ? "" : _props$className;
13054
+ return /*#__PURE__*/React__default.createElement("div", {
13055
+ className: "flex justify-center items-center max-w-full h-full aspect-video rounded-lg " + className,
13056
+ style: {
13057
+ backgroundColor: "#FAFAFA"
13058
+ }
13059
+ }, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
13060
+ width: "25%",
13061
+ height: "25%",
13062
+ fill: "#D9D9D9"
13063
+ }));
13064
+ };
13065
+ var NewsImage = function NewsImage(props) {
13066
+ var _props$size2 = props.size,
13067
+ size = _props$size2 === void 0 ? 0 : _props$size2,
13068
+ _props$className2 = props.className,
13069
+ className = _props$className2 === void 0 ? "" : _props$className2,
13070
+ news = props.news;
13071
+ var _useState = React.useState(""),
13072
+ src = _useState[0],
13073
+ setSrc = _useState[1];
13074
+ React.useEffect(function () {
13075
+ getNewsImage();
13076
+ }, [news]);
13077
+ var getNewsImage = function getNewsImage() {
13078
+ var src = news === null || news === void 0 ? void 0 : news.thumbnail;
13079
+ setSrc(src);
13080
+ };
13081
+ return src ? /*#__PURE__*/React__default.createElement("img", {
13082
+ src: src,
13083
+ className: "h-full rounded-lg max-w-full aspect-video " + className,
13084
+ style: size ? {
13085
+ width: size,
13086
+ height: size
13087
+ } : null
13088
+ }) : /*#__PURE__*/React__default.createElement(DefaultImage$1, {
13089
+ className: className,
13090
+ size: size
13091
+ });
13092
+ };
13093
+
13094
+ var NewsHighlight1 = function NewsHighlight1(props) {
13095
+ var _newsArticles$, _newsArticles$2, _newsArticles$3, _newsArticles$slice;
13096
+ var _props$SectionTitle = props.SectionTitle,
13097
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
13098
+ _props$shopConfigStyl = props.shopConfigStyle,
13099
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
13100
+ _props$Link = props.Link,
13101
+ Link = _props$Link === void 0 ? null : _props$Link,
13102
+ data = props.data;
13103
+ var _useState = React.useState({
13104
+ tags: "HIGHLIGHT",
13105
+ page: 0,
13106
+ size: 6,
13107
+ sort: "timeUpdate,DESC"
13108
+ }),
13109
+ params = _useState[0];
13110
+ var _NewsController = NewsController(_extends({}, props, {
13111
+ params: params
13112
+ })),
13113
+ _NewsController$newsA = _NewsController.newsArticles,
13114
+ newsArticles = _NewsController$newsA === void 0 ? [] : _NewsController$newsA;
13115
+ return /*#__PURE__*/React__default.createElement("div", {
13116
+ className: "" + SECTION_CLASS
13117
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
13118
+ data: data,
13119
+ shopConfigStyle: shopConfigStyle
13120
+ }), /*#__PURE__*/React__default.createElement("div", {
13121
+ className: "mt-12 mb-6 grid grid-cols-1 md:grid-cols-2 gap-6 "
13122
+ }, /*#__PURE__*/React__default.createElement(LinkToPage, {
13123
+ href: getLinkNewsDetail(newsArticles === null || newsArticles === void 0 ? void 0 : newsArticles[0]),
13124
+ Link: Link
13125
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(NewsImage, {
13126
+ news: newsArticles === null || newsArticles === void 0 ? void 0 : newsArticles[0]
13127
+ }), /*#__PURE__*/React__default.createElement("div", {
13128
+ className: "pt-3 font-medium text-lg"
13129
+ }, newsArticles === null || newsArticles === void 0 ? void 0 : (_newsArticles$ = newsArticles[0]) === null || _newsArticles$ === void 0 ? void 0 : _newsArticles$.title))), /*#__PURE__*/React__default.createElement("div", {
13130
+ className: "flex flex-col gap-6"
13131
+ }, /*#__PURE__*/React__default.createElement(LinkToPage, {
13132
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4 ",
13133
+ href: getLinkNewsDetail(newsArticles === null || newsArticles === void 0 ? void 0 : newsArticles[1]),
13134
+ Link: Link
13135
+ }, /*#__PURE__*/React__default.createElement(NewsImage, {
13136
+ news: newsArticles === null || newsArticles === void 0 ? void 0 : newsArticles[1]
13137
+ }), /*#__PURE__*/React__default.createElement("div", {
13138
+ className: "font-medium text-lg"
13139
+ }, newsArticles === null || newsArticles === void 0 ? void 0 : (_newsArticles$2 = newsArticles[1]) === null || _newsArticles$2 === void 0 ? void 0 : _newsArticles$2.title)), /*#__PURE__*/React__default.createElement(LinkToPage, {
13140
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
13141
+ href: getLinkNewsDetail(newsArticles === null || newsArticles === void 0 ? void 0 : newsArticles[2]),
13142
+ Link: Link
13143
+ }, /*#__PURE__*/React__default.createElement(NewsImage, {
13144
+ news: newsArticles === null || newsArticles === void 0 ? void 0 : newsArticles[2]
13145
+ }), /*#__PURE__*/React__default.createElement("div", {
13146
+ className: "font-medium text-lg"
13147
+ }, newsArticles === null || newsArticles === void 0 ? void 0 : (_newsArticles$3 = newsArticles[2]) === null || _newsArticles$3 === void 0 ? void 0 : _newsArticles$3.title)))), /*#__PURE__*/React__default.createElement("div", {
13148
+ className: "grid grid-cols-1 md:grid-cols-3 gap-6 mt-6 "
13149
+ }, newsArticles === null || newsArticles === void 0 ? void 0 : (_newsArticles$slice = newsArticles.slice(3, 6)) === null || _newsArticles$slice === void 0 ? void 0 : _newsArticles$slice.map(function (item, index) {
13150
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
13151
+ href: getLinkNewsDetail(item),
13152
+ Link: Link,
13153
+ key: "kdjf-" + index
13154
+ }, /*#__PURE__*/React__default.createElement("div", {
13155
+ className: "jgdfg-" + index
13156
+ }, /*#__PURE__*/React__default.createElement(NewsImage, {
13157
+ news: item
13158
+ }), /*#__PURE__*/React__default.createElement("div", {
13159
+ className: "font-medium text-lg py-2"
13160
+ }, item === null || item === void 0 ? void 0 : item.title)));
13161
+ })));
13162
+ };
13163
+
13164
+ var relativeTime = createCommonjsModule(function (module, exports) {
13165
+ !function(r,e){module.exports=e();}(commonjsGlobal,(function(){return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return "function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)};}}));
13166
+ });
13167
+
13168
+ var vi = createCommonjsModule(function (module, exports) {
13169
+ !function(t,n){module.exports=n(dayjs_min);}(commonjsGlobal,(function(t){function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var h=n(t),_={name:"vi",weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),weekStart:1,weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"}};return h.default.locale(_,null,!0),_}));
13170
+ });
13171
+
13172
+ var getAllNewsCategoriesApi = function getAllNewsCategoriesApi(shopId, landingShopConfigId, appId) {
13173
+ if (appId === void 0) {
13174
+ appId = "SSPA";
13175
+ }
13176
+ return api({
13177
+ method: "get",
13178
+ url: "/landing/news/category/get-all",
13179
+ params: {
13180
+ shopId: shopId,
13181
+ landingShopConfigId: landingShopConfigId,
13182
+ appId: appId,
13183
+ active: true
13184
+ }
13185
+ });
13186
+ };
13187
+
13188
+ var NewsCategoryController = function NewsCategoryController(props) {
13189
+ var params = props.params,
13190
+ shopConfig = props.shopConfig;
13191
+ var _useState = React.useState([]),
13192
+ newsCategories = _useState[0],
13193
+ setNewsCategories = _useState[1];
13194
+ React.useEffect(function () {
13195
+ if (shopConfig !== null && shopConfig !== void 0 && shopConfig.shopId && shopConfig !== null && shopConfig !== void 0 && shopConfig.landingShopConfigId) getAllNewsCategories();
13196
+ }, [shopConfig, params]);
13197
+ var getAllNewsCategories = function getAllNewsCategories() {
13198
+ try {
13199
+ var _temp = _catch(function () {
13200
+ return Promise.resolve(getAllNewsCategoriesApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingShopConfigId, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.appId)).then(function (res) {
13201
+ var _res$data, _res$data$status;
13202
+ if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
13203
+ var _res$data2;
13204
+ setNewsCategories(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data);
13205
+ }
13206
+ });
13207
+ }, function (error) {
13208
+ console.log(error);
13209
+ });
13210
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
13211
+ } catch (e) {
13212
+ return Promise.reject(e);
13213
+ }
13214
+ };
13215
+ return {
13216
+ newsCategories: newsCategories
13217
+ };
13218
+ };
13219
+
13220
+ dayjs_min.extend(relativeTime);
13221
+ dayjs_min.locale("vi");
13222
+ var News1 = function News1(props) {
13223
+ var _newsArticles$slice;
13224
+ var _props$shopConfigStyl = props.shopConfigStyle,
13225
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
13226
+ _props$Link = props.Link,
13227
+ Link = _props$Link === void 0 ? null : _props$Link,
13228
+ _props$catId = props.catId,
13229
+ catId = _props$catId === void 0 ? "" : _props$catId;
13230
+ var _useState = React.useState({
13231
+ page: 0,
13232
+ sort: "timeUpdate,DESC",
13233
+ size: 10,
13234
+ catId: catId
13235
+ }),
13236
+ params = _useState[0],
13237
+ setParams = _useState[1];
13238
+ var _useState2 = React.useState({}),
13239
+ categorySelected = _useState2[0],
13240
+ setCategorySelected = _useState2[1];
13241
+ var _useState3 = React.useState(true),
13242
+ isSeeMore = _useState3[0],
13243
+ setIsSeeMore = _useState3[1];
13244
+ var _NewsController = NewsController(_extends({}, props, {
13245
+ params: params
13246
+ })),
13247
+ _NewsController$newsA = _NewsController.newsArticles,
13248
+ newsArticles = _NewsController$newsA === void 0 ? [] : _NewsController$newsA,
13249
+ loading = _NewsController.loading;
13250
+ var _NewsCategoryControll = NewsCategoryController(props),
13251
+ _NewsCategoryControll2 = _NewsCategoryControll.newsCategories,
13252
+ newsCategories = _NewsCategoryControll2 === void 0 ? [] : _NewsCategoryControll2;
13253
+ var handleSeeMoreNews = function handleSeeMoreNews() {
13254
+ setIsSeeMore(false);
13255
+ setParams(function (prev) {
13256
+ return _extends({}, prev, {
13257
+ size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
13258
+ });
13259
+ });
13260
+ };
13261
+ React.useEffect(function () {
13262
+ if ((newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.length) > 0 && params !== null && params !== void 0 && params.catId) {
13263
+ var category = newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.find(function (item) {
13264
+ return (item === null || item === void 0 ? void 0 : item.catId) == catId;
13265
+ });
13266
+ setCategorySelected(category);
13267
+ }
13268
+ }, [params === null || params === void 0 ? void 0 : params.catId, newsCategories]);
13269
+ return /*#__PURE__*/React__default.createElement("div", {
13270
+ className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-3 gap-6"
13271
+ }, /*#__PURE__*/React__default.createElement("div", {
13272
+ className: "md:col-span-2 flex flex-col gap-8"
13273
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
13274
+ className: "px-6 py-3 text-textButton text-lg rounded-t-lg bg-primary w-max"
13275
+ }, params !== null && params !== void 0 && params.catId ? categorySelected === null || categorySelected === void 0 ? void 0 : categorySelected.catName : "Tin mới"), /*#__PURE__*/React__default.createElement("div", {
13276
+ className: "w-full border border-primary"
13277
+ })), loading & isSeeMore ? /*#__PURE__*/React__default.createElement("div", {
13278
+ className: "w-full h-80 flex justify-center items-center"
13279
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : /*#__PURE__*/React__default.createElement("div", {
13280
+ className: "flex flex-col gap-8"
13281
+ }, (newsArticles === null || newsArticles === void 0 ? void 0 : newsArticles.length) > 0 ? newsArticles === null || newsArticles === void 0 ? void 0 : (_newsArticles$slice = newsArticles.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _newsArticles$slice === void 0 ? void 0 : _newsArticles$slice.map(function (item, index) {
13282
+ var _dayjs;
13283
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
13284
+ href: getLinkNewsDetail(item),
13285
+ Link: Link,
13286
+ key: "kghf-" + index
13287
+ }, /*#__PURE__*/React__default.createElement("div", {
13288
+ className: "grid grid-cols-2 gap-2 md:gap-4 cursor-pointer",
13289
+ key: "djfsdf-" + index
13290
+ }, /*#__PURE__*/React__default.createElement(NewsImage, {
13291
+ news: item
13292
+ }), /*#__PURE__*/React__default.createElement("div", {
13293
+ className: "flex flex-col gap-2 md:gap-3 pb-4"
13294
+ }, /*#__PURE__*/React__default.createElement("div", {
13295
+ className: "font-medium text-lg md:text-xl line-clamp-2"
13296
+ }, item === null || item === void 0 ? void 0 : item.title), /*#__PURE__*/React__default.createElement("div", {
13297
+ className: "line-clamp-3 font-normal min-h-6 md:min-h-20 text-gray3"
13298
+ }, item === null || item === void 0 ? void 0 : item.shortDescription), /*#__PURE__*/React__default.createElement("div", {
13299
+ className: " text-gray3"
13300
+ }, (_dayjs = dayjs_min(item === null || item === void 0 ? void 0 : item.timeUpdate)) === null || _dayjs === void 0 ? void 0 : _dayjs.fromNow()))));
13301
+ }) : /*#__PURE__*/React__default.createElement("div", {
13302
+ className: "w-full h-64 flex flex-col justify-center items-center text-gray3"
13303
+ }, /*#__PURE__*/React__default.createElement(gi.GiNewspaper, {
13304
+ size: 80
13305
+ }), " Kh\xF4ng c\xF3 tin t\u1EE9c n\xE0o"), (newsArticles === null || newsArticles === void 0 ? void 0 : newsArticles.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
13306
+ label: "Xem th\xEAm",
13307
+ shopConfigStyle: shopConfigStyle,
13308
+ onClick: handleSeeMoreNews,
13309
+ className: "w-max mx-auto"
13310
+ }) : null)), /*#__PURE__*/React__default.createElement("div", {
13311
+ className: "sticky top-20 self-start"
13312
+ }, /*#__PURE__*/React__default.createElement("div", {
13313
+ className: "px-6 py-3 bg-primary rounded-t-lg text-lg text-textButton text-center"
13314
+ }, "Chuy\xEAn m\u1EE5c"), /*#__PURE__*/React__default.createElement("div", {
13315
+ className: "rounded-b-lg bg-bgSecondary"
13316
+ }, newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.map(function (item, index) {
13317
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
13318
+ href: getLinkNewsByCategory(item),
13319
+ Link: Link,
13320
+ key: "fjhnfg-" + index
13321
+ }, /*#__PURE__*/React__default.createElement("div", {
13322
+ className: "px-6 py-3 hover:bg-gray-100 hover:text-primary cursor-pointer",
13323
+ key: "sdjfdh-" + index
13324
+ }, item === null || item === void 0 ? void 0 : item.catName));
13325
+ }))));
13326
+ };
13327
+
13328
+ var NewsDetailController = function NewsDetailController(props) {
13329
+ var shopConfig = props.shopConfig,
13330
+ _props$articleId = props.articleId,
13331
+ articleId = _props$articleId === void 0 ? 0 : _props$articleId;
13332
+ var _useState = React.useState(),
13333
+ article = _useState[0],
13334
+ setArticle = _useState[1];
13335
+ React.useEffect(function () {
13336
+ if (articleId) {
13337
+ getProductDetail();
13338
+ }
13339
+ }, [articleId]);
13340
+ var getProductDetail = function getProductDetail() {
13341
+ try {
13342
+ var _temp = _catch(function () {
13343
+ return Promise.resolve(getNewsDetailApi(articleId, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingShopConfigId)).then(function (res) {
13344
+ var _res$data, _res$data$status;
13345
+ if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
13346
+ var _res$data2;
13347
+ setArticle(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data);
13348
+ }
13349
+ });
13350
+ }, function (e) {
13351
+ console.log(e);
13352
+ });
13353
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
13354
+ } catch (e) {
13355
+ return Promise.reject(e);
13356
+ }
13357
+ };
13358
+ return {
13359
+ article: article
13360
+ };
13361
+ };
13362
+
13363
+ dayjs_min.extend(relativeTime);
13364
+ dayjs_min.locale("vi");
13365
+ var NewsDetail1 = function NewsDetail1(props) {
13366
+ var shopConfigStyle = props.shopConfigStyle,
13367
+ _props$catId = props.catId,
13368
+ catId = _props$catId === void 0 ? 0 : _props$catId,
13369
+ _props$Link = props.Link,
13370
+ Link = _props$Link === void 0 ? null : _props$Link;
13371
+ var _useState = React.useState({
13372
+ catId: catId,
13373
+ szie: 10
13374
+ }),
13375
+ params = _useState[0],
13376
+ setParams = _useState[1];
13377
+ var _NewsDetailController = NewsDetailController(props),
13378
+ _NewsDetailController2 = _NewsDetailController.article,
13379
+ article = _NewsDetailController2 === void 0 ? {} : _NewsDetailController2;
13380
+ var _NewsCategoryControll = NewsCategoryController(props),
13381
+ _NewsCategoryControll2 = _NewsCategoryControll.newsCategories,
13382
+ newsCategories = _NewsCategoryControll2 === void 0 ? [] : _NewsCategoryControll2;
13383
+ var _NewsController = NewsController(_extends({}, props, {
13384
+ params: params
13385
+ })),
13386
+ _NewsController$newsA = _NewsController.newsArticles,
13387
+ newsArticles = _NewsController$newsA === void 0 ? [] : _NewsController$newsA;
13388
+ var handleSeeMore = function handleSeeMore() {
13389
+ setParams(function (prev) {
13390
+ return _extends({}, prev, {
13391
+ size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
13392
+ });
13393
+ });
13394
+ };
13395
+ return /*#__PURE__*/React__default.createElement("div", {
13396
+ className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-3 mt-0 md:mt-0 gap-6"
13397
+ }, /*#__PURE__*/React__default.createElement("div", {
13398
+ className: "md:col-span-2 flex flex-col gap-4"
13399
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
13400
+ className: "text-2xl font-medium"
13401
+ }, article === null || article === void 0 ? void 0 : article.title), /*#__PURE__*/React__default.createElement("div", {
13402
+ className: "flex items-center gap-2 text-gray3 mt-2"
13403
+ }, /*#__PURE__*/React__default.createElement(go.GoClock, null), dayjs_min(article === null || article === void 0 ? void 0 : article.timeUpdate).fromNow())), /*#__PURE__*/React__default.createElement("div", {
13404
+ className: "text-gray2"
13405
+ }, article === null || article === void 0 ? void 0 : article.shortDescription), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(NewsImage, {
13406
+ news: article
13407
+ })), /*#__PURE__*/React__default.createElement("div", {
13408
+ dangerouslySetInnerHTML: {
13409
+ __html: article === null || article === void 0 ? void 0 : article.content
13410
+ }
13411
+ }), /*#__PURE__*/React__default.createElement("div", {
13412
+ className: "mt-6"
13413
+ }, /*#__PURE__*/React__default.createElement("div", {
13414
+ className: "font-medium text-2xl mb-4"
13415
+ }, "Tin c\xF9ng chuy\xEAn m\u1EE5c"), /*#__PURE__*/React__default.createElement("div", {
13416
+ className: "grid grid-cols-1 md:grid-cols-2 gap-6"
13417
+ }, newsArticles === null || newsArticles === void 0 ? void 0 : newsArticles.map(function (item, index) {
13418
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
13419
+ href: getLinkNewsDetail(item),
13420
+ Link: Link,
13421
+ key: "kghf-" + index
13422
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(NewsImage, {
13423
+ news: item
13424
+ }), /*#__PURE__*/React__default.createElement("div", {
13425
+ className: "font-medium text-lg line-clamp-2"
13426
+ }, item === null || item === void 0 ? void 0 : item.title)));
13427
+ })), (newsArticles === null || newsArticles === void 0 ? void 0 : newsArticles.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement("div", {
13428
+ className: "flex justify-center mt-4 w-full"
13429
+ }, /*#__PURE__*/React__default.createElement(Button, {
13430
+ label: "Xem thêm",
13431
+ onClick: handleSeeMore,
13432
+ shopConfigStyle: shopConfigStyle
13433
+ })) : null)), /*#__PURE__*/React__default.createElement("div", {
13434
+ className: "sticky top-20 self-start"
13435
+ }, /*#__PURE__*/React__default.createElement("div", {
13436
+ className: "px-6 py-3 bg-primary rounded-t-lg text-lg text-textButton text-center"
13437
+ }, "Chuy\xEAn m\u1EE5c"), /*#__PURE__*/React__default.createElement("div", {
13438
+ className: "rounded-b-lg bg-bgSecondary"
13439
+ }, newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.map(function (item, index) {
13440
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
13441
+ href: getLinkNewsByCategory(item),
13442
+ Link: Link
13443
+ }, /*#__PURE__*/React__default.createElement("div", {
13444
+ className: "px-6 py-3 hover:bg-gray-100 hover:text-primary cursor-pointer",
13445
+ key: "sdjfdh-" + index
13446
+ }, item === null || item === void 0 ? void 0 : item.catName));
13447
+ }))));
13448
+ };
13449
+
12972
13450
  exports.About1 = About1;
12973
13451
  exports.About5 = About5;
12974
13452
  exports.Address1 = Address1;
@@ -13008,6 +13486,9 @@ exports.Links1 = Links1;
13008
13486
  exports.ModalNotification = ModalNotification;
13009
13487
  exports.NavBar1 = NavBar1;
13010
13488
  exports.NavBar7 = NavBar7;
13489
+ exports.News1 = News1;
13490
+ exports.NewsDetail1 = NewsDetail1;
13491
+ exports.NewsHighlight1 = NewsHighlight1;
13011
13492
  exports.PageTitle1 = PageTitle1;
13012
13493
  exports.Partner1 = Partner1;
13013
13494
  exports.ProductCategory2 = ProductCategory2;