nvis-fe-cms-libs 2.1.1 → 2.1.3
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.
|
@@ -4811,6 +4811,133 @@ var __async = (__this, __arguments, generator) => {
|
|
|
4811
4811
|
) })
|
|
4812
4812
|
] }) });
|
|
4813
4813
|
};
|
|
4814
|
+
const HeroBannerSection = ({ data, t, isDarkMode, imageBaseUrl = "" }) => {
|
|
4815
|
+
var _a, _b;
|
|
4816
|
+
const [activeSlide, setActiveSlide] = require$$0.useState(0);
|
|
4817
|
+
const extractBannerData = (data2) => {
|
|
4818
|
+
if (!(data2 == null ? void 0 : data2.sectionDataBindingItems) || data2.sectionDataBindingItems.length === 0) {
|
|
4819
|
+
return null;
|
|
4820
|
+
}
|
|
4821
|
+
const item = data2.sectionDataBindingItems[0];
|
|
4822
|
+
if (!item || !item.data) {
|
|
4823
|
+
return null;
|
|
4824
|
+
}
|
|
4825
|
+
const bannerData2 = item.data;
|
|
4826
|
+
if (!bannerData2.id && !bannerData2.name) {
|
|
4827
|
+
return null;
|
|
4828
|
+
}
|
|
4829
|
+
const extractedData = {
|
|
4830
|
+
id: bannerData2.id,
|
|
4831
|
+
name: bannerData2.name || "",
|
|
4832
|
+
description: bannerData2.description || "",
|
|
4833
|
+
images: Array.isArray(bannerData2.images) ? bannerData2.images : []
|
|
4834
|
+
};
|
|
4835
|
+
return extractedData;
|
|
4836
|
+
};
|
|
4837
|
+
const bannerData = extractBannerData(data);
|
|
4838
|
+
const getImageUrl = (imagePath) => {
|
|
4839
|
+
if (!imagePath) {
|
|
4840
|
+
return null;
|
|
4841
|
+
}
|
|
4842
|
+
if (imagePath.startsWith("http://") || imagePath.startsWith("https://")) {
|
|
4843
|
+
return imagePath;
|
|
4844
|
+
}
|
|
4845
|
+
return `${imageBaseUrl}${imagePath}`;
|
|
4846
|
+
};
|
|
4847
|
+
const slideImages = ((_a = bannerData == null ? void 0 : bannerData.images) == null ? void 0 : _a.map((img) => ({
|
|
4848
|
+
id: img.id || `img-${Math.random()}`,
|
|
4849
|
+
url: getImageUrl(img.url)
|
|
4850
|
+
}))) || [];
|
|
4851
|
+
require$$0.useEffect(() => {
|
|
4852
|
+
if (slideImages.length <= 1) return;
|
|
4853
|
+
const interval = setInterval(() => {
|
|
4854
|
+
setActiveSlide((prev) => (prev + 1) % slideImages.length);
|
|
4855
|
+
}, 5e3);
|
|
4856
|
+
return () => clearInterval(interval);
|
|
4857
|
+
}, [slideImages.length]);
|
|
4858
|
+
const defaultImage = "https://images.unsplash.com/photo-1566073771259-6a8506099945?w=1920&h=1080&fit=crop&q=80";
|
|
4859
|
+
if (!bannerData) {
|
|
4860
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-20 bg-body", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 text-center", children: [
|
|
4861
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold mb-2 text-main", children: (t == null ? void 0 : t("banner.noData.title")) || "Chưa có dữ liệu" }),
|
|
4862
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-muted", children: (t == null ? void 0 : t("banner.noData.description")) || "Hiện tại chưa có banner nào được thiết lập." })
|
|
4863
|
+
] }) });
|
|
4864
|
+
}
|
|
4865
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(SectionWrapper, { isDarkMode, children: [
|
|
4866
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute inset-0 overflow-hidden pointer-events-none", children: [
|
|
4867
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4868
|
+
"div",
|
|
4869
|
+
{
|
|
4870
|
+
className: "absolute top-0 right-0 w-96 h-96 rounded-full opacity-20 blur-3xl",
|
|
4871
|
+
style: {
|
|
4872
|
+
background: isDarkMode ? "#1086CD" : "#1E3888"
|
|
4873
|
+
}
|
|
4874
|
+
}
|
|
4875
|
+
),
|
|
4876
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4877
|
+
"div",
|
|
4878
|
+
{
|
|
4879
|
+
className: "absolute bottom-0 left-0 w-96 h-96 rounded-full opacity-10 blur-3xl",
|
|
4880
|
+
style: {
|
|
4881
|
+
background: isDarkMode ? "#1E3888" : "#1086CD"
|
|
4882
|
+
}
|
|
4883
|
+
}
|
|
4884
|
+
)
|
|
4885
|
+
] }),
|
|
4886
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative max-w-7xl mx-auto px-6 sm:px-8 lg:px-12", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col lg:flex-row items-center justify-between gap-8 lg:gap-12", children: [
|
|
4887
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full lg:w-1/2 lg:pr-8 lg:self-start lg:pt-8", children: [
|
|
4888
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4889
|
+
"div",
|
|
4890
|
+
{
|
|
4891
|
+
className: "leading-tight mb-6",
|
|
4892
|
+
style: {
|
|
4893
|
+
color: isDarkMode ? "#F8FAFC" : "#1E3888"
|
|
4894
|
+
},
|
|
4895
|
+
dangerouslySetInnerHTML: { __html: bannerData.name }
|
|
4896
|
+
}
|
|
4897
|
+
),
|
|
4898
|
+
bannerData.description && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4899
|
+
"div",
|
|
4900
|
+
{
|
|
4901
|
+
className: "text-lg sm:text-xl leading-relaxed mb-8",
|
|
4902
|
+
style: {
|
|
4903
|
+
color: isDarkMode ? "#CBD5E1" : "#475569"
|
|
4904
|
+
},
|
|
4905
|
+
dangerouslySetInnerHTML: { __html: bannerData.description }
|
|
4906
|
+
}
|
|
4907
|
+
)
|
|
4908
|
+
] }),
|
|
4909
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full lg:w-1/2 relative py-4 md:py-4 lg:py-5", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative overflow-hidden shadow-2xl", style: { borderRadius: "48px 0 48px 0" }, children: [
|
|
4910
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4911
|
+
"img",
|
|
4912
|
+
{
|
|
4913
|
+
src: ((_b = slideImages[activeSlide]) == null ? void 0 : _b.url) || defaultImage,
|
|
4914
|
+
alt: bannerData.name,
|
|
4915
|
+
className: "w-full h-auto object-cover transition-all duration-1000",
|
|
4916
|
+
style: {
|
|
4917
|
+
aspectRatio: "4/3",
|
|
4918
|
+
maxHeight: "500px"
|
|
4919
|
+
},
|
|
4920
|
+
onError: (e) => {
|
|
4921
|
+
e.target.src = defaultImage;
|
|
4922
|
+
}
|
|
4923
|
+
}
|
|
4924
|
+
),
|
|
4925
|
+
slideImages.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute top-4 right-4 flex gap-2", children: slideImages.map((_, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4926
|
+
"button",
|
|
4927
|
+
{
|
|
4928
|
+
onClick: () => setActiveSlide(index2),
|
|
4929
|
+
className: "w-2 h-2 rounded-full transition-all duration-300",
|
|
4930
|
+
style: {
|
|
4931
|
+
background: activeSlide === index2 ? "white" : "rgba(255, 255, 255, 0.5)",
|
|
4932
|
+
width: activeSlide === index2 ? "24px" : "8px"
|
|
4933
|
+
}
|
|
4934
|
+
},
|
|
4935
|
+
index2
|
|
4936
|
+
)) })
|
|
4937
|
+
] }) })
|
|
4938
|
+
] }) })
|
|
4939
|
+
] });
|
|
4940
|
+
};
|
|
4814
4941
|
const index = {
|
|
4815
4942
|
AboutCompanySection,
|
|
4816
4943
|
CompanyValues,
|
|
@@ -4834,7 +4961,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
4834
4961
|
PageHighlightSection,
|
|
4835
4962
|
PageChildrenSelectSection,
|
|
4836
4963
|
PageChildrenSelectSection1,
|
|
4837
|
-
PageChildrenSelectSection2
|
|
4964
|
+
PageChildrenSelectSection2,
|
|
4965
|
+
HeroBannerSection
|
|
4838
4966
|
};
|
|
4839
4967
|
exports2.AboutCompanySection = AboutCompanySection;
|
|
4840
4968
|
exports2.CompanyValues = CompanyValues;
|
|
@@ -4845,6 +4973,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
4845
4973
|
exports2.DiagramSection = DiagramSection;
|
|
4846
4974
|
exports2.DiagramSection2 = DiagramSection2;
|
|
4847
4975
|
exports2.FaqSection = FaqSection;
|
|
4976
|
+
exports2.HeroBannerSection = HeroBannerSection;
|
|
4848
4977
|
exports2.MilestoneSection = MilestoneSection;
|
|
4849
4978
|
exports2.PageChildrenSelectSection = PageChildrenSelectSection;
|
|
4850
4979
|
exports2.PageChildrenSelectSection1 = PageChildrenSelectSection1;
|