nvis-fe-cms-libs 1.0.1 → 1.0.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.
|
@@ -1,4 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
var __async = (__this, __arguments, generator) => {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
var fulfilled = (value) => {
|
|
35
|
+
try {
|
|
36
|
+
step(generator.next(value));
|
|
37
|
+
} catch (e) {
|
|
38
|
+
reject(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var rejected = (value) => {
|
|
42
|
+
try {
|
|
43
|
+
step(generator.throw(value));
|
|
44
|
+
} catch (e) {
|
|
45
|
+
reject(e);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
import require$$0, { useRef, useState, useEffect, useMemo, forwardRef, createElement } from "react";
|
|
2
53
|
var jsxRuntime = { exports: {} };
|
|
3
54
|
var reactJsxRuntime_production = {};
|
|
4
55
|
/**
|
|
@@ -903,7 +954,7 @@ const PartnerCard = ({ partner, idx, t, getLogoUrl, isDarkMode }) => {
|
|
|
903
954
|
}
|
|
904
955
|
);
|
|
905
956
|
};
|
|
906
|
-
function useWindowSize() {
|
|
957
|
+
function useWindowSize$1() {
|
|
907
958
|
const [width, setWidth] = useState(
|
|
908
959
|
typeof window !== "undefined" ? window.innerWidth : 1200
|
|
909
960
|
);
|
|
@@ -921,7 +972,7 @@ const PartnersSection = ({ data, t, isDarkMode, imageBaseUrl = "" }) => {
|
|
|
921
972
|
const [currentPartnerSlide, setCurrentPartnerSlide] = useState(0);
|
|
922
973
|
const [partnersVisible, setPartnersVisible] = useState(false);
|
|
923
974
|
const partnersRef = useRef(null);
|
|
924
|
-
const windowWidth = useWindowSize();
|
|
975
|
+
const windowWidth = useWindowSize$1();
|
|
925
976
|
const getLogoUrl = (logoUrl) => {
|
|
926
977
|
if (!logoUrl) return null;
|
|
927
978
|
if (logoUrl.startsWith("http")) return logoUrl;
|
|
@@ -1029,18 +1080,2038 @@ const PartnersSection = ({ data, t, isDarkMode, imageBaseUrl = "" }) => {
|
|
|
1029
1080
|
}
|
|
1030
1081
|
);
|
|
1031
1082
|
};
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1083
|
+
const MilestoneSection = ({ data, t, isDarkMode, getMilestoneTimeline }) => {
|
|
1084
|
+
const [milestones, setMilestones] = useState([]);
|
|
1085
|
+
const [loading, setLoading] = useState(true);
|
|
1086
|
+
const [timelineVisible, setTimelineVisible] = useState([]);
|
|
1087
|
+
const timelineRefs = useRef([]);
|
|
1088
|
+
useEffect(() => {
|
|
1089
|
+
const fetchMilestones = () => __async(null, null, function* () {
|
|
1090
|
+
var _a;
|
|
1091
|
+
if (getMilestoneTimeline) {
|
|
1092
|
+
try {
|
|
1093
|
+
setLoading(true);
|
|
1094
|
+
const res = yield getMilestoneTimeline();
|
|
1095
|
+
if (res.success) {
|
|
1096
|
+
setMilestones(res.data || []);
|
|
1097
|
+
} else {
|
|
1098
|
+
setMilestones([]);
|
|
1099
|
+
}
|
|
1100
|
+
} catch (error) {
|
|
1101
|
+
setMilestones([]);
|
|
1102
|
+
} finally {
|
|
1103
|
+
setLoading(false);
|
|
1104
|
+
}
|
|
1105
|
+
} else {
|
|
1106
|
+
const milestonesData = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => item.data)) || [];
|
|
1107
|
+
setMilestones(milestonesData);
|
|
1108
|
+
setLoading(false);
|
|
1109
|
+
}
|
|
1110
|
+
});
|
|
1111
|
+
fetchMilestones();
|
|
1112
|
+
}, []);
|
|
1113
|
+
useEffect(() => {
|
|
1114
|
+
setTimelineVisible(new Array(milestones.length).fill(false));
|
|
1115
|
+
}, [milestones.length]);
|
|
1116
|
+
useEffect(() => {
|
|
1117
|
+
const observer = new IntersectionObserver(
|
|
1118
|
+
(entries) => {
|
|
1119
|
+
entries.forEach((entry) => {
|
|
1120
|
+
if (entry.isIntersecting) {
|
|
1121
|
+
const index2 = timelineRefs.current.findIndex(
|
|
1122
|
+
(el) => el === entry.target
|
|
1123
|
+
);
|
|
1124
|
+
if (index2 !== -1) {
|
|
1125
|
+
setTimelineVisible((prev) => {
|
|
1126
|
+
const newVisible = [...prev];
|
|
1127
|
+
newVisible[index2] = true;
|
|
1128
|
+
return newVisible;
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
observer.unobserve(entry.target);
|
|
1132
|
+
}
|
|
1133
|
+
});
|
|
1134
|
+
},
|
|
1135
|
+
{ threshold: 0.1 }
|
|
1136
|
+
);
|
|
1137
|
+
timelineRefs.current.forEach((el) => el && observer.observe(el));
|
|
1138
|
+
return () => {
|
|
1139
|
+
timelineRefs.current.forEach((el) => el && observer.unobserve(el));
|
|
1140
|
+
};
|
|
1141
|
+
}, [milestones.length]);
|
|
1142
|
+
if (loading) {
|
|
1143
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-20 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: isDarkMode ? "text-white" : "text-gray-800", children: t("milestone.status.loadingData") }) });
|
|
1144
|
+
}
|
|
1145
|
+
if (!milestones.length) {
|
|
1146
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1147
|
+
"section",
|
|
1148
|
+
{
|
|
1149
|
+
className: `py-20 ${isDarkMode ? "bg-gray-900/50" : "bg-white"}`,
|
|
1150
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 text-center", children: [
|
|
1151
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1152
|
+
"h3",
|
|
1153
|
+
{
|
|
1154
|
+
className: `text-lg font-semibold mb-2 ${isDarkMode ? "text-white" : "text-gray-900"}`,
|
|
1155
|
+
children: t("milestone.status.noData")
|
|
1156
|
+
}
|
|
1157
|
+
),
|
|
1158
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1159
|
+
"p",
|
|
1160
|
+
{
|
|
1161
|
+
className: `${isDarkMode ? "text-gray-300" : "text-gray-600"}`,
|
|
1162
|
+
children: t("milestone.noDataDescription")
|
|
1163
|
+
}
|
|
1164
|
+
)
|
|
1165
|
+
] })
|
|
1166
|
+
}
|
|
1167
|
+
);
|
|
1168
|
+
}
|
|
1169
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1170
|
+
"section",
|
|
1171
|
+
{
|
|
1172
|
+
className: `py-20 ${isDarkMode ? "bg-gray-800" : "bg-white"}`,
|
|
1173
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
|
|
1174
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center mb-12", children: [
|
|
1175
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1176
|
+
"div",
|
|
1177
|
+
{
|
|
1178
|
+
className: `relative inline-block px-4 py-2 rounded-full text-sm font-semibold mb-4 border transition-all duration-300 transform hover:scale-105 shadow-md hover:shadow-lg overflow-hidden ${isDarkMode ? "bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900 text-emerald-300 border-blue-800" : "bg-white text-emerald-800 border-gray-200"}`,
|
|
1179
|
+
children: [
|
|
1180
|
+
"📈 ",
|
|
1181
|
+
t("milestone.header.badge")
|
|
1182
|
+
]
|
|
1183
|
+
}
|
|
1184
|
+
),
|
|
1185
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1186
|
+
"h2",
|
|
1187
|
+
{
|
|
1188
|
+
className: `text-3xl lg:text-4xl font-bold mb-4 ${isDarkMode ? "text-white" : "text-gray-900"}`,
|
|
1189
|
+
children: [
|
|
1190
|
+
t("milestone.header.title"),
|
|
1191
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block bg-gradient-to-r from-emerald-600 to-teal-600 bg-clip-text text-transparent", children: t("milestone.header.subtitle") })
|
|
1192
|
+
]
|
|
1193
|
+
}
|
|
1194
|
+
)
|
|
1195
|
+
] }),
|
|
1196
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
|
|
1197
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute left-1/2 transform -translate-x-1/2 w-1 h-full bg-gradient-to-b from-blue-500 to-purple-600 rounded-full" }),
|
|
1198
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-8", children: milestones.map((milestone, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1199
|
+
"div",
|
|
1200
|
+
{
|
|
1201
|
+
ref: (el) => timelineRefs.current[index2] = el,
|
|
1202
|
+
className: `flex items-center transition-all duration-700 ease-out ${index2 % 2 === 0 ? "flex-row" : "flex-row-reverse"} ${timelineVisible[index2] ? "opacity-100 scale-100" : "opacity-0 scale-75"}`,
|
|
1203
|
+
style: { transitionDelay: `${index2 * 200}ms` },
|
|
1204
|
+
children: [
|
|
1205
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 px-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1206
|
+
"div",
|
|
1207
|
+
{
|
|
1208
|
+
className: `relative p-5 rounded-xl shadow-lg transition-all duration-300 hover:shadow-xl overflow-hidden ${isDarkMode ? "bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900 border border-blue-800 hover:border-blue-600" : "bg-gray-50 hover:shadow-2xl"}`,
|
|
1209
|
+
children: [
|
|
1210
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-blue-600 font-bold text-xl mb-2", children: milestone.time }),
|
|
1211
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1212
|
+
"h3",
|
|
1213
|
+
{
|
|
1214
|
+
className: `text-lg font-bold mb-2 ${isDarkMode ? "text-white" : "text-gray-900"}`,
|
|
1215
|
+
children: milestone.title
|
|
1216
|
+
}
|
|
1217
|
+
),
|
|
1218
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1219
|
+
"p",
|
|
1220
|
+
{
|
|
1221
|
+
className: `${isDarkMode ? "text-gray-300" : "text-gray-600"}`,
|
|
1222
|
+
children: milestone.description
|
|
1223
|
+
}
|
|
1224
|
+
)
|
|
1225
|
+
]
|
|
1226
|
+
}
|
|
1227
|
+
) }),
|
|
1228
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1229
|
+
"div",
|
|
1230
|
+
{
|
|
1231
|
+
className: `w-6 h-6 bg-gradient-to-r from-blue-500 to-purple-600 rounded-full border-4 ${isDarkMode ? "border-gray-800" : "border-white"} shadow-[0_0_10px_5px_rgba(59,130,246,0.5)] flex-shrink-0 z-10 animate-pulse`
|
|
1232
|
+
}
|
|
1233
|
+
),
|
|
1234
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1" })
|
|
1235
|
+
]
|
|
1236
|
+
},
|
|
1237
|
+
milestone.id
|
|
1238
|
+
)) })
|
|
1239
|
+
] })
|
|
1240
|
+
] })
|
|
1241
|
+
}
|
|
1242
|
+
);
|
|
1243
|
+
};
|
|
1244
|
+
const TestimonialsSection = ({ data, t, isDarkMode }) => {
|
|
1245
|
+
var _a;
|
|
1246
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
1247
|
+
const testimonials = ((_a = data == null ? void 0 : data.sectionDataBindingItems) == null ? void 0 : _a.map((item) => ({
|
|
1248
|
+
quote: item.data.content,
|
|
1249
|
+
author: item.data.customerName,
|
|
1250
|
+
position: item.data.customerTitle || t("testimonials.fallback.defaultPosition"),
|
|
1251
|
+
company: item.data.customerCompany || ""
|
|
1252
|
+
}))) || [];
|
|
1253
|
+
const fallbackTestimonials = [
|
|
1254
|
+
{
|
|
1255
|
+
quote: t("testimonials.fallback.testimonial1.quote"),
|
|
1256
|
+
author: t("testimonials.fallback.testimonial1.author"),
|
|
1257
|
+
position: t("testimonials.fallback.testimonial1.position"),
|
|
1258
|
+
company: t("testimonials.fallback.testimonial1.company")
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
quote: t("testimonials.fallback.testimonial2.quote"),
|
|
1262
|
+
author: t("testimonials.fallback.testimonial2.author"),
|
|
1263
|
+
position: t("testimonials.fallback.testimonial2.position"),
|
|
1264
|
+
company: t("testimonials.fallback.testimonial2.company")
|
|
1265
|
+
},
|
|
1266
|
+
{
|
|
1267
|
+
quote: t("testimonials.fallback.testimonial3.quote"),
|
|
1268
|
+
author: t("testimonials.fallback.testimonial3.author"),
|
|
1269
|
+
position: t("testimonials.fallback.testimonial3.position"),
|
|
1270
|
+
company: t("testimonials.fallback.testimonial3.company")
|
|
1271
|
+
}
|
|
1272
|
+
];
|
|
1273
|
+
const displayTestimonials = testimonials.length > 0 ? testimonials : fallbackTestimonials;
|
|
1274
|
+
useEffect(() => {
|
|
1275
|
+
if (displayTestimonials.length > 1) {
|
|
1276
|
+
const interval = setInterval(() => {
|
|
1277
|
+
setCurrentIndex((prev) => (prev + 1) % displayTestimonials.length);
|
|
1278
|
+
}, 5e3);
|
|
1279
|
+
return () => clearInterval(interval);
|
|
1280
|
+
}
|
|
1281
|
+
}, [displayTestimonials.length]);
|
|
1282
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1283
|
+
"section",
|
|
1284
|
+
{
|
|
1285
|
+
className: `py-20 transition-colors duration-200 ${isDarkMode ? "bg-gray-700" : "bg-gray-50"}`,
|
|
1286
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center", children: [
|
|
1287
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1288
|
+
"div",
|
|
1289
|
+
{
|
|
1290
|
+
className: `inline-block px-4 py-2 rounded-full text-sm font-semibold mb-4 ${isDarkMode ? "bg-indigo-900/50 text-indigo-300 border border-indigo-800" : "bg-indigo-100 text-indigo-800"}`,
|
|
1291
|
+
children: [
|
|
1292
|
+
"💬 ",
|
|
1293
|
+
t("testimonials.header.badge")
|
|
1294
|
+
]
|
|
1295
|
+
}
|
|
1296
|
+
),
|
|
1297
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1298
|
+
"h2",
|
|
1299
|
+
{
|
|
1300
|
+
className: `text-3xl lg:text-4xl font-bold mb-8 transition-colors duration-200 ${isDarkMode ? "text-white" : "text-gray-900"}`,
|
|
1301
|
+
children: [
|
|
1302
|
+
t("testimonials.header.title"),
|
|
1303
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block bg-gradient-to-r from-indigo-600 to-purple-600 bg-clip-text text-transparent", children: t("testimonials.header.subtitle") })
|
|
1304
|
+
]
|
|
1305
|
+
}
|
|
1306
|
+
),
|
|
1307
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
|
|
1308
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1309
|
+
"div",
|
|
1310
|
+
{
|
|
1311
|
+
className: `p-6 rounded-2xl transition-all duration-500 transform ${isDarkMode ? "bg-gray-800/80 backdrop-blur-sm border border-gray-700" : "bg-white"}`,
|
|
1312
|
+
children: [
|
|
1313
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1314
|
+
"blockquote",
|
|
1315
|
+
{
|
|
1316
|
+
className: `text-lg lg:text-xl italic mb-6 animate-fadeIn transition-colors duration-200 ${isDarkMode ? "text-gray-300" : "text-gray-700"}`,
|
|
1317
|
+
children: [
|
|
1318
|
+
'"',
|
|
1319
|
+
displayTestimonials[currentIndex].quote,
|
|
1320
|
+
'"'
|
|
1321
|
+
]
|
|
1322
|
+
}
|
|
1323
|
+
),
|
|
1324
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center space-x-4 animate-fadeIn", children: [
|
|
1325
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-3xl", children: "👤" }),
|
|
1326
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-left", children: [
|
|
1327
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1328
|
+
"div",
|
|
1329
|
+
{
|
|
1330
|
+
className: `font-bold text-base transition-colors duration-200 ${isDarkMode ? "text-white" : "text-gray-900"}`,
|
|
1331
|
+
children: displayTestimonials[currentIndex].author
|
|
1332
|
+
}
|
|
1333
|
+
),
|
|
1334
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-blue-600 font-medium text-sm", children: displayTestimonials[currentIndex].position }),
|
|
1335
|
+
displayTestimonials[currentIndex].company && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1336
|
+
"div",
|
|
1337
|
+
{
|
|
1338
|
+
className: `text-xs transition-colors duration-200 ${isDarkMode ? "text-gray-400" : "text-gray-600"}`,
|
|
1339
|
+
children: displayTestimonials[currentIndex].company
|
|
1340
|
+
}
|
|
1341
|
+
)
|
|
1342
|
+
] })
|
|
1343
|
+
] })
|
|
1344
|
+
]
|
|
1345
|
+
},
|
|
1346
|
+
currentIndex
|
|
1347
|
+
),
|
|
1348
|
+
displayTestimonials.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center space-x-2 mt-4", children: displayTestimonials.map((_, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1349
|
+
"button",
|
|
1350
|
+
{
|
|
1351
|
+
onClick: () => setCurrentIndex(index2),
|
|
1352
|
+
className: `w-2.5 h-2.5 rounded-full transition-all duration-300 ${index2 === currentIndex ? "bg-blue-600" : isDarkMode ? "bg-gray-600 hover:bg-gray-500" : "bg-gray-300 hover:bg-gray-400"}`
|
|
1353
|
+
},
|
|
1354
|
+
index2
|
|
1355
|
+
)) })
|
|
1356
|
+
] })
|
|
1357
|
+
] })
|
|
1358
|
+
}
|
|
1359
|
+
);
|
|
1360
|
+
};
|
|
1361
|
+
const PartnerListCard = ({ partner, idx = 0, t, isDarkMode, getLogoUrl }) => {
|
|
1362
|
+
const itemRef = useRef(null);
|
|
1363
|
+
const [visible, setVisible] = useState(false);
|
|
1364
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
1365
|
+
if (!partner) return null;
|
|
1366
|
+
useEffect(() => {
|
|
1367
|
+
const observer = new IntersectionObserver(
|
|
1368
|
+
(entries) => {
|
|
1369
|
+
entries.forEach((entry) => {
|
|
1370
|
+
if (entry.isIntersecting) {
|
|
1371
|
+
setVisible(true);
|
|
1372
|
+
observer.unobserve(entry.target);
|
|
1373
|
+
}
|
|
1374
|
+
});
|
|
1375
|
+
},
|
|
1376
|
+
{ threshold: 0.2 }
|
|
1377
|
+
);
|
|
1378
|
+
if (itemRef.current) observer.observe(itemRef.current);
|
|
1379
|
+
return () => itemRef.current && observer.unobserve(itemRef.current);
|
|
1380
|
+
}, []);
|
|
1381
|
+
const logoSrc = getLogoUrl ? getLogoUrl(partner.logoUrl) : null;
|
|
1382
|
+
const handleImageError = (e) => {
|
|
1383
|
+
e.target.style.display = "none";
|
|
1384
|
+
e.target.nextSibling.style.display = "flex";
|
|
1385
|
+
};
|
|
1386
|
+
const handleClick = () => {
|
|
1387
|
+
if (partner.websiteUrl) {
|
|
1388
|
+
window.open(partner.websiteUrl, "_blank", "noopener,noreferrer");
|
|
1389
|
+
}
|
|
1390
|
+
};
|
|
1391
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1392
|
+
"div",
|
|
1393
|
+
{
|
|
1394
|
+
ref: itemRef,
|
|
1395
|
+
className: `relative flex flex-col items-center justify-center p-4 rounded-xl shadow-sm transition-all duration-700 ease-out cursor-pointer overflow-hidden min-h-[180px]
|
|
1396
|
+
${isDarkMode ? "bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900 border border-blue-800" : "bg-white border border-gray-200"}
|
|
1397
|
+
${visible ? "opacity-100 scale-100" : "opacity-0 scale-75"}
|
|
1398
|
+
${isHovered ? isDarkMode ? "border-blue-500 shadow-lg shadow-blue-500/20 -translate-y-1" : "border-blue-300 shadow-lg shadow-blue-500/20 -translate-y-1" : ""}`,
|
|
1399
|
+
style: {
|
|
1400
|
+
transitionDelay: `${idx * 150}ms`,
|
|
1401
|
+
transform: `translateY(${isHovered ? "-4px" : "0px"}) scale(${visible ? "1" : "0.75"})`
|
|
1402
|
+
},
|
|
1403
|
+
onMouseEnter: () => setIsHovered(true),
|
|
1404
|
+
onMouseLeave: () => setIsHovered(false),
|
|
1405
|
+
onClick: handleClick,
|
|
1406
|
+
children: [
|
|
1407
|
+
isDarkMode && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1408
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute w-12 h-12 bg-white/5 rounded-full", style: { left: "10%", top: "20%" } }),
|
|
1409
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute w-10 h-10 bg-white/5 rounded-full", style: { right: "30%", bottom: "10%" } }),
|
|
1410
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute w-14 h-14 bg-white/5 rounded-md", style: { left: "20%", bottom: "30%" } }),
|
|
1411
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 opacity-20", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1412
|
+
"div",
|
|
1413
|
+
{
|
|
1414
|
+
style: {
|
|
1415
|
+
backgroundImage: `url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`,
|
|
1416
|
+
backgroundSize: "60px 60px"
|
|
1417
|
+
},
|
|
1418
|
+
className: "w-full h-full"
|
|
1419
|
+
}
|
|
1420
|
+
) })
|
|
1421
|
+
] }),
|
|
1422
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1423
|
+
"div",
|
|
1424
|
+
{
|
|
1425
|
+
className: `w-20 h-14 flex items-center justify-center mb-4 rounded-lg overflow-hidden border transition-all duration-300
|
|
1426
|
+
${isDarkMode ? "border-gray-600" : "border-gray-200"}
|
|
1427
|
+
${isHovered ? "border-blue-500" : ""}
|
|
1428
|
+
`,
|
|
1429
|
+
style: {
|
|
1430
|
+
background: isDarkMode ? isHovered ? "linear-gradient(135deg, #4b5563 0%, #374151 100%)" : "linear-gradient(135deg, #374151 0%, #1f2937 100%)" : isHovered ? "linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)" : "linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%)"
|
|
1431
|
+
},
|
|
1432
|
+
children: logoSrc ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1433
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1434
|
+
"img",
|
|
1435
|
+
{
|
|
1436
|
+
src: logoSrc,
|
|
1437
|
+
alt: partner.name || t("partners.logoAlt") || "Partner logo",
|
|
1438
|
+
className: "max-w-full max-h-full object-contain transition-all duration-300",
|
|
1439
|
+
style: {
|
|
1440
|
+
filter: isDarkMode ? isHovered ? "grayscale(0) opacity(1)" : "grayscale(0.3) opacity(0.8)" : isHovered ? "grayscale(0) opacity(1)" : "grayscale(0.2) opacity(0.9)",
|
|
1441
|
+
transform: isHovered ? "scale(1.05)" : "scale(1)"
|
|
1442
|
+
},
|
|
1443
|
+
onError: handleImageError,
|
|
1444
|
+
loading: "lazy"
|
|
1445
|
+
}
|
|
1446
|
+
),
|
|
1447
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full h-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center", style: { display: "none" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-bold text-center text-sm px-1", children: partner.name }) })
|
|
1448
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-full h-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-bold text-center text-sm px-1", children: partner.name }) })
|
|
1449
|
+
}
|
|
1450
|
+
),
|
|
1451
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: `font-bold text-center mb-2 text-sm leading-tight ${isDarkMode ? "text-white" : "text-gray-900"}`, children: partner.name }),
|
|
1452
|
+
partner.description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-xs text-center mb-3 line-clamp-2 px-1 ${isDarkMode ? "text-gray-300" : "text-gray-600"}`, children: partner.description }),
|
|
1453
|
+
partner.websiteUrl && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1454
|
+
"div",
|
|
1455
|
+
{
|
|
1456
|
+
className: "transition-all duration-300",
|
|
1457
|
+
style: {
|
|
1458
|
+
opacity: isHovered ? 1 : 0,
|
|
1459
|
+
transform: `translateY(${isHovered ? "0px" : "4px"})`
|
|
1460
|
+
},
|
|
1461
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-blue-600 font-medium", children: [
|
|
1462
|
+
t("partners.viewDetails") || "Xem chi tiết",
|
|
1463
|
+
" →"
|
|
1464
|
+
] })
|
|
1465
|
+
}
|
|
1466
|
+
)
|
|
1467
|
+
]
|
|
1468
|
+
}
|
|
1469
|
+
);
|
|
1470
|
+
};
|
|
1471
|
+
function useWindowSize() {
|
|
1472
|
+
const [width, setWidth] = useState(
|
|
1473
|
+
typeof window !== "undefined" ? window.innerWidth : 1200
|
|
1474
|
+
);
|
|
1475
|
+
useEffect(() => {
|
|
1476
|
+
const handleResize = () => setWidth(window.innerWidth);
|
|
1477
|
+
window.addEventListener("resize", handleResize);
|
|
1478
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
1479
|
+
}, []);
|
|
1480
|
+
return width;
|
|
1481
|
+
}
|
|
1482
|
+
const PartnerListSection = ({ t, isDarkMode, getPartnerList, imageBaseUrl = "" }) => {
|
|
1483
|
+
const [partnersData, setPartnersData] = useState([]);
|
|
1484
|
+
const [error, setError] = useState(null);
|
|
1485
|
+
const [loading, setLoading] = useState(true);
|
|
1486
|
+
const [currentPartnerSlide, setCurrentPartnerSlide] = useState(0);
|
|
1487
|
+
const [partnersVisible, setPartnersVisible] = useState(false);
|
|
1488
|
+
const partnersRef = useRef(null);
|
|
1489
|
+
const windowWidth = useWindowSize();
|
|
1490
|
+
const getLogoUrl = (logoUrl) => {
|
|
1491
|
+
if (!logoUrl) return null;
|
|
1492
|
+
if (logoUrl.startsWith("http")) return logoUrl;
|
|
1493
|
+
return `${imageBaseUrl}${logoUrl}`;
|
|
1494
|
+
};
|
|
1495
|
+
useEffect(() => {
|
|
1496
|
+
const fetchData = () => __async(null, null, function* () {
|
|
1497
|
+
try {
|
|
1498
|
+
const res = yield getPartnerList();
|
|
1499
|
+
if (res.success) {
|
|
1500
|
+
setPartnersData(res.data || []);
|
|
1501
|
+
} else {
|
|
1502
|
+
setError(res.error || "Error fetching partners");
|
|
1503
|
+
}
|
|
1504
|
+
} catch (err) {
|
|
1505
|
+
setError(err.message);
|
|
1506
|
+
} finally {
|
|
1507
|
+
setLoading(false);
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
fetchData();
|
|
1511
|
+
}, []);
|
|
1512
|
+
const partners = useMemo(() => {
|
|
1513
|
+
const getPerSlide = () => {
|
|
1514
|
+
if (windowWidth < 640) return 2;
|
|
1515
|
+
if (windowWidth < 1024) return 3;
|
|
1516
|
+
return 4;
|
|
1517
|
+
};
|
|
1518
|
+
const grouped = [];
|
|
1519
|
+
const perSlide = getPerSlide();
|
|
1520
|
+
for (let i = 0; i < partnersData.length; i += perSlide) {
|
|
1521
|
+
grouped.push(partnersData.slice(i, i + perSlide));
|
|
1522
|
+
}
|
|
1523
|
+
return grouped;
|
|
1524
|
+
}, [partnersData, windowWidth]);
|
|
1525
|
+
useEffect(() => {
|
|
1526
|
+
if (partners.length > 1) {
|
|
1527
|
+
const interval = setInterval(() => {
|
|
1528
|
+
setCurrentPartnerSlide((prev) => (prev + 1) % partners.length);
|
|
1529
|
+
}, 5e3);
|
|
1530
|
+
return () => clearInterval(interval);
|
|
1531
|
+
}
|
|
1532
|
+
}, [partners.length]);
|
|
1533
|
+
useEffect(() => {
|
|
1534
|
+
const fallbackTimer = setTimeout(() => {
|
|
1535
|
+
setPartnersVisible(true);
|
|
1536
|
+
}, 500);
|
|
1537
|
+
const observer = new IntersectionObserver(
|
|
1538
|
+
(entries) => {
|
|
1539
|
+
entries.forEach((entry) => {
|
|
1540
|
+
if (entry.isIntersecting) {
|
|
1541
|
+
clearTimeout(fallbackTimer);
|
|
1542
|
+
setPartnersVisible(true);
|
|
1543
|
+
observer.unobserve(entry.target);
|
|
1544
|
+
}
|
|
1545
|
+
});
|
|
1546
|
+
},
|
|
1547
|
+
{ threshold: 0.1, rootMargin: "50px" }
|
|
1548
|
+
);
|
|
1549
|
+
if (partnersRef.current) {
|
|
1550
|
+
observer.observe(partnersRef.current);
|
|
1551
|
+
} else {
|
|
1552
|
+
clearTimeout(fallbackTimer);
|
|
1553
|
+
setPartnersVisible(true);
|
|
1554
|
+
}
|
|
1555
|
+
return () => {
|
|
1556
|
+
clearTimeout(fallbackTimer);
|
|
1557
|
+
if (partnersRef.current) {
|
|
1558
|
+
observer.unobserve(partnersRef.current);
|
|
1559
|
+
}
|
|
1560
|
+
};
|
|
1561
|
+
}, []);
|
|
1562
|
+
if (loading) {
|
|
1563
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-20 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: isDarkMode ? "text-white" : "text-gray-800", children: t("partners.loading") || "Đang tải danh sách đối tác..." }) });
|
|
1564
|
+
}
|
|
1565
|
+
if (error) {
|
|
1566
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "py-20 text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-500", children: t("partners.error") || error }) });
|
|
1567
|
+
}
|
|
1568
|
+
if (!partnersData.length) return null;
|
|
1569
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1570
|
+
"section",
|
|
1571
|
+
{
|
|
1572
|
+
className: `py-12 lg:py-20 transition-colors duration-300 ${isDarkMode ? "bg-gradient-to-b from-gray-950 via-gray-900 to-gray-800" : "bg-gradient-to-b from-white via-gray-50 to-gray-100"}`,
|
|
1573
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
|
|
1574
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center mb-12", children: [
|
|
1575
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1576
|
+
"div",
|
|
1577
|
+
{
|
|
1578
|
+
className: `inline-block px-4 py-2 rounded-full text-sm font-semibold mb-4 border shadow-sm ${isDarkMode ? "bg-blue-900/30 text-blue-300 border-blue-800" : "bg-blue-100 text-blue-800 border-blue-200"}`,
|
|
1579
|
+
children: [
|
|
1580
|
+
"🤝 ",
|
|
1581
|
+
t("partners.badge") || "ĐỐI TÁC CHIẾN LƯỢC"
|
|
1582
|
+
]
|
|
1583
|
+
}
|
|
1584
|
+
),
|
|
1585
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1586
|
+
"h2",
|
|
1587
|
+
{
|
|
1588
|
+
className: `text-3xl lg:text-5xl font-bold leading-tight ${isDarkMode ? "text-white" : "text-gray-800"}`,
|
|
1589
|
+
children: [
|
|
1590
|
+
t("partners.title.part1") || "Đồng hành cùng",
|
|
1591
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block bg-gradient-to-r from-blue-500 to-purple-500 bg-clip-text text-transparent mt-2", children: t("partners.title.part2") || "Những thương hiệu hàng đầu" })
|
|
1592
|
+
]
|
|
1593
|
+
}
|
|
1594
|
+
)
|
|
1595
|
+
] }),
|
|
1596
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: partnersRef, className: "relative", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1597
|
+
"div",
|
|
1598
|
+
{
|
|
1599
|
+
className: `transition-all duration-1000 ease-out ${partnersVisible ? "opacity-100 scale-100" : "opacity-0 scale-95"}`,
|
|
1600
|
+
children: [
|
|
1601
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative overflow-hidden mb-8", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-[220px]", children: partners.map((group, slideIndex) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1602
|
+
"div",
|
|
1603
|
+
{
|
|
1604
|
+
className: `absolute inset-0 w-full transition-all duration-1000 ease-in-out ${slideIndex === currentPartnerSlide ? "opacity-100 translate-x-0" : slideIndex < currentPartnerSlide ? "opacity-0 -translate-x-full" : "opacity-0 translate-x-full"}`,
|
|
1605
|
+
style: { zIndex: slideIndex === currentPartnerSlide ? 10 : 1 },
|
|
1606
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-6 px-2", children: group.map((partner, idx) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1607
|
+
PartnerListCard,
|
|
1608
|
+
{
|
|
1609
|
+
partner,
|
|
1610
|
+
idx,
|
|
1611
|
+
t,
|
|
1612
|
+
isDarkMode,
|
|
1613
|
+
getLogoUrl
|
|
1614
|
+
},
|
|
1615
|
+
partner.id || `${slideIndex}-${idx}`
|
|
1616
|
+
)) })
|
|
1617
|
+
},
|
|
1618
|
+
slideIndex
|
|
1619
|
+
)) }) }),
|
|
1620
|
+
partners.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center space-x-2", style: { zIndex: 50 }, children: partners.map((_, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1621
|
+
"button",
|
|
1622
|
+
{
|
|
1623
|
+
onClick: () => setCurrentPartnerSlide(index2),
|
|
1624
|
+
className: `w-3 h-3 rounded-full transition-all duration-300 ${index2 === currentPartnerSlide ? "bg-blue-500 scale-125 shadow-lg" : isDarkMode ? "bg-gray-600 hover:bg-blue-400" : "bg-gray-300 hover:bg-blue-500"}`,
|
|
1625
|
+
"aria-label": `Slide ${index2 + 1}`
|
|
1626
|
+
},
|
|
1627
|
+
index2
|
|
1628
|
+
)) })
|
|
1629
|
+
]
|
|
1630
|
+
}
|
|
1631
|
+
) })
|
|
1632
|
+
] })
|
|
1633
|
+
}
|
|
1634
|
+
);
|
|
1635
|
+
};
|
|
1636
|
+
/**
|
|
1637
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1638
|
+
*
|
|
1639
|
+
* This source code is licensed under the ISC license.
|
|
1640
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1641
|
+
*/
|
|
1642
|
+
const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1643
|
+
const toCamelCase = (string) => string.replace(
|
|
1644
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
1645
|
+
(match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
|
|
1646
|
+
);
|
|
1647
|
+
const toPascalCase = (string) => {
|
|
1648
|
+
const camelCase = toCamelCase(string);
|
|
1649
|
+
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
1650
|
+
};
|
|
1651
|
+
const mergeClasses = (...classes) => classes.filter((className, index2, array) => {
|
|
1652
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
|
|
1653
|
+
}).join(" ").trim();
|
|
1654
|
+
const hasA11yProp = (props) => {
|
|
1655
|
+
for (const prop in props) {
|
|
1656
|
+
if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
|
|
1657
|
+
return true;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
};
|
|
1661
|
+
/**
|
|
1662
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1663
|
+
*
|
|
1664
|
+
* This source code is licensed under the ISC license.
|
|
1665
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1666
|
+
*/
|
|
1667
|
+
var defaultAttributes = {
|
|
1668
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1669
|
+
width: 24,
|
|
1670
|
+
height: 24,
|
|
1671
|
+
viewBox: "0 0 24 24",
|
|
1672
|
+
fill: "none",
|
|
1673
|
+
stroke: "currentColor",
|
|
1674
|
+
strokeWidth: 2,
|
|
1675
|
+
strokeLinecap: "round",
|
|
1676
|
+
strokeLinejoin: "round"
|
|
1677
|
+
};
|
|
1678
|
+
/**
|
|
1679
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1680
|
+
*
|
|
1681
|
+
* This source code is licensed under the ISC license.
|
|
1682
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1683
|
+
*/
|
|
1684
|
+
const Icon = forwardRef(
|
|
1685
|
+
(_a, ref) => {
|
|
1686
|
+
var _b = _a, {
|
|
1687
|
+
color = "currentColor",
|
|
1688
|
+
size = 24,
|
|
1689
|
+
strokeWidth = 2,
|
|
1690
|
+
absoluteStrokeWidth,
|
|
1691
|
+
className = "",
|
|
1692
|
+
children,
|
|
1693
|
+
iconNode
|
|
1694
|
+
} = _b, rest = __objRest(_b, [
|
|
1695
|
+
"color",
|
|
1696
|
+
"size",
|
|
1697
|
+
"strokeWidth",
|
|
1698
|
+
"absoluteStrokeWidth",
|
|
1699
|
+
"className",
|
|
1700
|
+
"children",
|
|
1701
|
+
"iconNode"
|
|
1702
|
+
]);
|
|
1703
|
+
return createElement(
|
|
1704
|
+
"svg",
|
|
1705
|
+
__spreadValues(__spreadValues(__spreadProps(__spreadValues({
|
|
1706
|
+
ref
|
|
1707
|
+
}, defaultAttributes), {
|
|
1708
|
+
width: size,
|
|
1709
|
+
height: size,
|
|
1710
|
+
stroke: color,
|
|
1711
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
1712
|
+
className: mergeClasses("lucide", className)
|
|
1713
|
+
}), !children && !hasA11yProp(rest) && { "aria-hidden": "true" }), rest),
|
|
1714
|
+
[
|
|
1715
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
1716
|
+
...Array.isArray(children) ? children : [children]
|
|
1717
|
+
]
|
|
1718
|
+
);
|
|
1719
|
+
}
|
|
1720
|
+
);
|
|
1721
|
+
/**
|
|
1722
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1723
|
+
*
|
|
1724
|
+
* This source code is licensed under the ISC license.
|
|
1725
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1726
|
+
*/
|
|
1727
|
+
const createLucideIcon = (iconName, iconNode) => {
|
|
1728
|
+
const Component = forwardRef(
|
|
1729
|
+
(_a, ref) => {
|
|
1730
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1731
|
+
return createElement(Icon, __spreadValues({
|
|
1732
|
+
ref,
|
|
1733
|
+
iconNode,
|
|
1734
|
+
className: mergeClasses(
|
|
1735
|
+
`lucide-${toKebabCase(toPascalCase(iconName))}`,
|
|
1736
|
+
`lucide-${iconName}`,
|
|
1737
|
+
className
|
|
1738
|
+
)
|
|
1739
|
+
}, props));
|
|
1740
|
+
}
|
|
1741
|
+
);
|
|
1742
|
+
Component.displayName = toPascalCase(iconName);
|
|
1743
|
+
return Component;
|
|
1744
|
+
};
|
|
1745
|
+
/**
|
|
1746
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1747
|
+
*
|
|
1748
|
+
* This source code is licensed under the ISC license.
|
|
1749
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1750
|
+
*/
|
|
1751
|
+
const __iconNode$9 = [
|
|
1752
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
1753
|
+
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
1754
|
+
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
1755
|
+
];
|
|
1756
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$9);
|
|
1757
|
+
/**
|
|
1758
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1759
|
+
*
|
|
1760
|
+
* This source code is licensed under the ISC license.
|
|
1761
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1762
|
+
*/
|
|
1763
|
+
const __iconNode$8 = [
|
|
1764
|
+
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
1765
|
+
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
1766
|
+
];
|
|
1767
|
+
const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$8);
|
|
1768
|
+
/**
|
|
1769
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1770
|
+
*
|
|
1771
|
+
* This source code is licensed under the ISC license.
|
|
1772
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1773
|
+
*/
|
|
1774
|
+
const __iconNode$7 = [
|
|
1775
|
+
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
|
|
1776
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
1777
|
+
];
|
|
1778
|
+
const Clock = createLucideIcon("clock", __iconNode$7);
|
|
1779
|
+
/**
|
|
1780
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1781
|
+
*
|
|
1782
|
+
* This source code is licensed under the ISC license.
|
|
1783
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1784
|
+
*/
|
|
1785
|
+
const __iconNode$6 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
1786
|
+
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$6);
|
|
1787
|
+
/**
|
|
1788
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1789
|
+
*
|
|
1790
|
+
* This source code is licensed under the ISC license.
|
|
1791
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1792
|
+
*/
|
|
1793
|
+
const __iconNode$5 = [
|
|
1794
|
+
["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
|
|
1795
|
+
["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
|
|
1796
|
+
];
|
|
1797
|
+
const Mail = createLucideIcon("mail", __iconNode$5);
|
|
1798
|
+
/**
|
|
1799
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1800
|
+
*
|
|
1801
|
+
* This source code is licensed under the ISC license.
|
|
1802
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1803
|
+
*/
|
|
1804
|
+
const __iconNode$4 = [
|
|
1805
|
+
[
|
|
1806
|
+
"path",
|
|
1807
|
+
{
|
|
1808
|
+
d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",
|
|
1809
|
+
key: "1sd12s"
|
|
1810
|
+
}
|
|
1811
|
+
]
|
|
1812
|
+
];
|
|
1813
|
+
const MessageCircle = createLucideIcon("message-circle", __iconNode$4);
|
|
1814
|
+
/**
|
|
1815
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1816
|
+
*
|
|
1817
|
+
* This source code is licensed under the ISC license.
|
|
1818
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1819
|
+
*/
|
|
1820
|
+
const __iconNode$3 = [
|
|
1821
|
+
[
|
|
1822
|
+
"path",
|
|
1823
|
+
{
|
|
1824
|
+
d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",
|
|
1825
|
+
key: "18887p"
|
|
1826
|
+
}
|
|
1827
|
+
]
|
|
1828
|
+
];
|
|
1829
|
+
const MessageSquare = createLucideIcon("message-square", __iconNode$3);
|
|
1830
|
+
/**
|
|
1831
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1832
|
+
*
|
|
1833
|
+
* This source code is licensed under the ISC license.
|
|
1834
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1835
|
+
*/
|
|
1836
|
+
const __iconNode$2 = [
|
|
1837
|
+
[
|
|
1838
|
+
"path",
|
|
1839
|
+
{
|
|
1840
|
+
d: "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",
|
|
1841
|
+
key: "9njp5v"
|
|
1842
|
+
}
|
|
1843
|
+
]
|
|
1844
|
+
];
|
|
1845
|
+
const Phone = createLucideIcon("phone", __iconNode$2);
|
|
1846
|
+
/**
|
|
1847
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1848
|
+
*
|
|
1849
|
+
* This source code is licensed under the ISC license.
|
|
1850
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1851
|
+
*/
|
|
1852
|
+
const __iconNode$1 = [
|
|
1853
|
+
[
|
|
1854
|
+
"path",
|
|
1855
|
+
{
|
|
1856
|
+
d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
|
|
1857
|
+
key: "1ffxy3"
|
|
1858
|
+
}
|
|
1859
|
+
],
|
|
1860
|
+
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
1861
|
+
];
|
|
1862
|
+
const Send = createLucideIcon("send", __iconNode$1);
|
|
1863
|
+
/**
|
|
1864
|
+
* @license lucide-react v0.544.0 - ISC
|
|
1865
|
+
*
|
|
1866
|
+
* This source code is licensed under the ISC license.
|
|
1867
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1868
|
+
*/
|
|
1869
|
+
const __iconNode = [
|
|
1870
|
+
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
1871
|
+
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
1872
|
+
];
|
|
1873
|
+
const User = createLucideIcon("user", __iconNode);
|
|
1874
|
+
const ContactFormSection = ({ data, t, isDarkMode, consultationRequestService }) => {
|
|
1875
|
+
const [formData, setFormData] = useState({
|
|
1876
|
+
fullName: "",
|
|
1877
|
+
workEmail: "",
|
|
1878
|
+
phoneNumber: "",
|
|
1879
|
+
companyName: "",
|
|
1880
|
+
jobTitle: "",
|
|
1881
|
+
businessType: "",
|
|
1882
|
+
expectedBudget: "",
|
|
1883
|
+
expectedTimeline: "",
|
|
1884
|
+
requestTitle: "",
|
|
1885
|
+
requestDescription: ""
|
|
1886
|
+
});
|
|
1887
|
+
const [formErrors, setFormErrors] = useState({});
|
|
1888
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
1889
|
+
const [submitStatus, setSubmitStatus] = useState(null);
|
|
1890
|
+
const [submitMessage, setSubmitMessage] = useState("");
|
|
1891
|
+
const validateField = (name, value) => {
|
|
1892
|
+
const errors = {};
|
|
1893
|
+
switch (name) {
|
|
1894
|
+
case "fullName":
|
|
1895
|
+
if (!(value == null ? void 0 : value.trim())) errors.fullName = "Họ và tên là bắt buộc";
|
|
1896
|
+
else if (value.trim().length < 2) errors.fullName = "Tên phải có ít nhất 2 ký tự";
|
|
1897
|
+
break;
|
|
1898
|
+
case "workEmail":
|
|
1899
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
1900
|
+
if (!(value == null ? void 0 : value.trim())) errors.workEmail = "Email là bắt buộc";
|
|
1901
|
+
else if (!emailRegex.test(value.trim())) errors.workEmail = "Email không hợp lệ";
|
|
1902
|
+
break;
|
|
1903
|
+
case "phoneNumber":
|
|
1904
|
+
const phoneRegex = /^[0-9\s\-\+\(\)]{10,15}$/;
|
|
1905
|
+
if (value && !phoneRegex.test(value.trim())) errors.phoneNumber = "Số điện thoại không hợp lệ";
|
|
1906
|
+
break;
|
|
1907
|
+
case "requestTitle":
|
|
1908
|
+
if (!(value == null ? void 0 : value.trim())) errors.requestTitle = "Tiêu đề yêu cầu là bắt buộc";
|
|
1909
|
+
else if (value.trim().length < 5) errors.requestTitle = "Tiêu đề phải có ít nhất 5 ký tự";
|
|
1910
|
+
break;
|
|
1911
|
+
case "requestDescription":
|
|
1912
|
+
if (!(value == null ? void 0 : value.trim())) errors.requestDescription = "Mô tả yêu cầu là bắt buộc";
|
|
1913
|
+
else if (value.trim().length < 10) errors.requestDescription = "Mô tả phải có ít nhất 10 ký tự";
|
|
1914
|
+
break;
|
|
1915
|
+
case "companyName":
|
|
1916
|
+
if (value && value.trim().length > 0 && value.trim().length < 2) {
|
|
1917
|
+
errors.companyName = "Tên công ty phải có ít nhất 2 ký tự";
|
|
1918
|
+
}
|
|
1919
|
+
break;
|
|
1920
|
+
case "jobTitle":
|
|
1921
|
+
if (value && value.trim().length > 0 && value.trim().length < 2) {
|
|
1922
|
+
errors.jobTitle = "Chức vụ phải có ít nhất 2 ký tự";
|
|
1923
|
+
}
|
|
1924
|
+
break;
|
|
1925
|
+
}
|
|
1926
|
+
return errors;
|
|
1927
|
+
};
|
|
1928
|
+
const handleInputChange = (e) => {
|
|
1929
|
+
const { name, value } = e.target;
|
|
1930
|
+
setFormData((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
1931
|
+
[name]: value || ""
|
|
1932
|
+
}));
|
|
1933
|
+
if (formErrors[name]) {
|
|
1934
|
+
setFormErrors((prev) => {
|
|
1935
|
+
const newErrors = __spreadValues({}, prev);
|
|
1936
|
+
delete newErrors[name];
|
|
1937
|
+
return newErrors;
|
|
1938
|
+
});
|
|
1939
|
+
}
|
|
1940
|
+
};
|
|
1941
|
+
const handleBlur = (e) => {
|
|
1942
|
+
const { name, value } = e.target;
|
|
1943
|
+
const fieldErrors = validateField(name, value);
|
|
1944
|
+
setFormErrors((prev) => __spreadValues(__spreadValues({}, prev), fieldErrors));
|
|
1945
|
+
};
|
|
1946
|
+
const handleSubmit = (e) => __async(null, null, function* () {
|
|
1947
|
+
e.preventDefault();
|
|
1948
|
+
setIsSubmitting(true);
|
|
1949
|
+
setSubmitStatus(null);
|
|
1950
|
+
setSubmitMessage("");
|
|
1951
|
+
try {
|
|
1952
|
+
const allErrors = {};
|
|
1953
|
+
Object.keys(formData).forEach((key) => {
|
|
1954
|
+
const fieldErrors = validateField(key, formData[key]);
|
|
1955
|
+
Object.assign(allErrors, fieldErrors);
|
|
1956
|
+
});
|
|
1957
|
+
if (Object.keys(allErrors).length > 0) {
|
|
1958
|
+
setFormErrors(allErrors);
|
|
1959
|
+
setIsSubmitting(false);
|
|
1960
|
+
return;
|
|
1961
|
+
}
|
|
1962
|
+
const cleanFormData = Object.keys(formData).reduce((acc, key) => {
|
|
1963
|
+
acc[key] = typeof formData[key] === "string" ? formData[key].trim() : formData[key];
|
|
1964
|
+
return acc;
|
|
1965
|
+
}, {});
|
|
1966
|
+
let result;
|
|
1967
|
+
if (consultationRequestService == null ? void 0 : consultationRequestService.create) {
|
|
1968
|
+
result = yield consultationRequestService.create(cleanFormData);
|
|
1969
|
+
} else {
|
|
1970
|
+
yield new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
1971
|
+
result = { success: true, message: "Đã gửi thông tin thành công!" };
|
|
1972
|
+
}
|
|
1973
|
+
if (result == null ? void 0 : result.success) {
|
|
1974
|
+
setSubmitStatus("success");
|
|
1975
|
+
setSubmitMessage(result.message || "Cảm ơn bạn đã gửi thông tin! Chúng tôi sẽ liên hệ lại trong vòng 24 giờ.");
|
|
1976
|
+
setFormData({
|
|
1977
|
+
fullName: "",
|
|
1978
|
+
workEmail: "",
|
|
1979
|
+
phoneNumber: "",
|
|
1980
|
+
companyName: "",
|
|
1981
|
+
jobTitle: "",
|
|
1982
|
+
businessType: "",
|
|
1983
|
+
expectedBudget: "",
|
|
1984
|
+
expectedTimeline: "",
|
|
1985
|
+
requestTitle: "",
|
|
1986
|
+
requestDescription: ""
|
|
1987
|
+
});
|
|
1988
|
+
setFormErrors({});
|
|
1989
|
+
} else {
|
|
1990
|
+
setSubmitStatus("error");
|
|
1991
|
+
setSubmitMessage((result == null ? void 0 : result.message) || "Có lỗi xảy ra khi gửi thông tin.");
|
|
1992
|
+
}
|
|
1993
|
+
} catch (error) {
|
|
1994
|
+
setSubmitStatus("error");
|
|
1995
|
+
setSubmitMessage((error == null ? void 0 : error.message) || "Có lỗi xảy ra khi gửi thông tin. Vui lòng thử lại sau.");
|
|
1996
|
+
} finally {
|
|
1997
|
+
setIsSubmitting(false);
|
|
1998
|
+
}
|
|
1999
|
+
});
|
|
2000
|
+
const inputBaseClasses = `w-full px-4 py-3 rounded-xl border transition-all duration-200 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none ${isDarkMode ? "bg-gray-700 border-gray-600 text-white placeholder-gray-400 focus:border-indigo-500" : "bg-white border-slate-300 text-slate-900 placeholder-slate-500 focus:border-indigo-500"}`;
|
|
2001
|
+
const labelClasses = `block text-sm font-semibold mb-2 ${isDarkMode ? "text-gray-300" : "text-slate-700"}`;
|
|
2002
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: `py-16 transition-colors duration-200 ${isDarkMode ? "bg-gray-950" : "bg-white"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid lg:grid-cols-3 gap-12", children: [
|
|
2003
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "lg:col-span-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `rounded-2xl p-8 shadow-lg border transition-colors duration-200 ${isDarkMode ? "bg-gray-800 border-gray-700" : "bg-white border-slate-200"}`, children: [
|
|
2004
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mb-6", children: [
|
|
2005
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-r from-indigo-500 to-purple-600 flex items-center justify-center mr-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { size: 20, className: "text-white" }) }),
|
|
2006
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2007
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: `text-2xl font-bold transition-colors duration-200 ${isDarkMode ? "text-white" : "text-slate-800"}`, children: t("form.title") || "Gửi yêu cầu tư vấn" }),
|
|
2008
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm transition-colors duration-200 ${isDarkMode ? "text-gray-400" : "text-slate-600"}`, children: t("form.subtitle") || "Điền thông tin để nhận tư vấn miễn phí từ chuyên gia" })
|
|
2009
|
+
] })
|
|
2010
|
+
] }),
|
|
2011
|
+
submitStatus && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `mb-6 p-4 rounded-xl border transition-colors duration-200 ${submitStatus === "success" ? isDarkMode ? "bg-emerald-900/50 border-emerald-700 text-emerald-300" : "bg-emerald-50 border-emerald-200 text-emerald-800" : isDarkMode ? "bg-red-900/50 border-red-700 text-red-300" : "bg-red-50 border-red-200 text-red-800"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center", children: [
|
|
2012
|
+
submitStatus === "success" ? /* @__PURE__ */ jsxRuntimeExports.jsx(CircleCheckBig, { size: 20, className: "mr-2 flex-shrink-0" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { size: 20, className: "mr-2 flex-shrink-0" }),
|
|
2013
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium", children: submitMessage })
|
|
2014
|
+
] }) }),
|
|
2015
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [
|
|
2016
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid md:grid-cols-2 gap-6", children: [
|
|
2017
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2018
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: labelClasses, children: [
|
|
2019
|
+
t("form.fields.fullName") || "Họ và tên",
|
|
2020
|
+
" *"
|
|
2021
|
+
] }),
|
|
2022
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2023
|
+
"input",
|
|
2024
|
+
{
|
|
2025
|
+
type: "text",
|
|
2026
|
+
name: "fullName",
|
|
2027
|
+
value: formData.fullName || "",
|
|
2028
|
+
onChange: handleInputChange,
|
|
2029
|
+
onBlur: handleBlur,
|
|
2030
|
+
className: `${inputBaseClasses} ${formErrors.fullName ? "border-red-500" : ""}`,
|
|
2031
|
+
placeholder: "Nguyễn Văn A",
|
|
2032
|
+
required: true
|
|
2033
|
+
}
|
|
2034
|
+
),
|
|
2035
|
+
formErrors.fullName && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-1 text-sm text-red-500 flex items-center", children: [
|
|
2036
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { size: 14, className: "mr-1" }),
|
|
2037
|
+
formErrors.fullName
|
|
2038
|
+
] })
|
|
2039
|
+
] }),
|
|
2040
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2041
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: labelClasses, children: [
|
|
2042
|
+
t("form.fields.workEmail") || "Email",
|
|
2043
|
+
" *"
|
|
2044
|
+
] }),
|
|
2045
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2046
|
+
"input",
|
|
2047
|
+
{
|
|
2048
|
+
type: "email",
|
|
2049
|
+
name: "workEmail",
|
|
2050
|
+
value: formData.workEmail || "",
|
|
2051
|
+
onChange: handleInputChange,
|
|
2052
|
+
onBlur: handleBlur,
|
|
2053
|
+
className: `${inputBaseClasses} ${formErrors.workEmail ? "border-red-500" : ""}`,
|
|
2054
|
+
placeholder: "email@company.com",
|
|
2055
|
+
required: true
|
|
2056
|
+
}
|
|
2057
|
+
),
|
|
2058
|
+
formErrors.workEmail && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-1 text-sm text-red-500 flex items-center", children: [
|
|
2059
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { size: 14, className: "mr-1" }),
|
|
2060
|
+
formErrors.workEmail
|
|
2061
|
+
] })
|
|
2062
|
+
] })
|
|
2063
|
+
] }),
|
|
2064
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid md:grid-cols-2 gap-6", children: [
|
|
2065
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2066
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: labelClasses, children: t("form.fields.phoneNumber") || "Số điện thoại" }),
|
|
2067
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2068
|
+
"input",
|
|
2069
|
+
{
|
|
2070
|
+
type: "tel",
|
|
2071
|
+
name: "phoneNumber",
|
|
2072
|
+
value: formData.phoneNumber || "",
|
|
2073
|
+
onChange: handleInputChange,
|
|
2074
|
+
onBlur: handleBlur,
|
|
2075
|
+
className: `${inputBaseClasses} ${formErrors.phoneNumber ? "border-red-500" : ""}`,
|
|
2076
|
+
placeholder: "0901 234 567"
|
|
2077
|
+
}
|
|
2078
|
+
),
|
|
2079
|
+
formErrors.phoneNumber && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-1 text-sm text-red-500 flex items-center", children: [
|
|
2080
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { size: 14, className: "mr-1" }),
|
|
2081
|
+
formErrors.phoneNumber
|
|
2082
|
+
] })
|
|
2083
|
+
] }),
|
|
2084
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2085
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: labelClasses, children: t("form.fields.companyName") || "Công ty/Tổ chức" }),
|
|
2086
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2087
|
+
"input",
|
|
2088
|
+
{
|
|
2089
|
+
type: "text",
|
|
2090
|
+
name: "companyName",
|
|
2091
|
+
value: formData.companyName || "",
|
|
2092
|
+
onChange: handleInputChange,
|
|
2093
|
+
onBlur: handleBlur,
|
|
2094
|
+
className: `${inputBaseClasses} ${formErrors.companyName ? "border-red-500" : ""}`,
|
|
2095
|
+
placeholder: "ABC Company"
|
|
2096
|
+
}
|
|
2097
|
+
),
|
|
2098
|
+
formErrors.companyName && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-1 text-sm text-red-500 flex items-center", children: [
|
|
2099
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { size: 14, className: "mr-1" }),
|
|
2100
|
+
formErrors.companyName
|
|
2101
|
+
] })
|
|
2102
|
+
] })
|
|
2103
|
+
] }),
|
|
2104
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid md:grid-cols-2 gap-6", children: [
|
|
2105
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2106
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: labelClasses, children: t("form.fields.jobTitle") || "Chức vụ" }),
|
|
2107
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2108
|
+
"input",
|
|
2109
|
+
{
|
|
2110
|
+
type: "text",
|
|
2111
|
+
name: "jobTitle",
|
|
2112
|
+
value: formData.jobTitle || "",
|
|
2113
|
+
onChange: handleInputChange,
|
|
2114
|
+
onBlur: handleBlur,
|
|
2115
|
+
className: `${inputBaseClasses} ${formErrors.jobTitle ? "border-red-500" : ""}`,
|
|
2116
|
+
placeholder: "Giám đốc công nghệ"
|
|
2117
|
+
}
|
|
2118
|
+
),
|
|
2119
|
+
formErrors.jobTitle && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-1 text-sm text-red-500 flex items-center", children: [
|
|
2120
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { size: 14, className: "mr-1" }),
|
|
2121
|
+
formErrors.jobTitle
|
|
2122
|
+
] })
|
|
2123
|
+
] }),
|
|
2124
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2125
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: labelClasses, children: t("form.fields.businessType") || "Loại hình kinh doanh" }),
|
|
2126
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2127
|
+
"input",
|
|
2128
|
+
{
|
|
2129
|
+
type: "text",
|
|
2130
|
+
name: "businessType",
|
|
2131
|
+
value: formData.businessType || "",
|
|
2132
|
+
onChange: handleInputChange,
|
|
2133
|
+
className: inputBaseClasses,
|
|
2134
|
+
placeholder: "Công nghệ thông tin"
|
|
2135
|
+
}
|
|
2136
|
+
)
|
|
2137
|
+
] })
|
|
2138
|
+
] }),
|
|
2139
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid md:grid-cols-2 gap-6", children: [
|
|
2140
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2141
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: labelClasses, children: t("form.fields.expectedBudget") || "Ngân sách dự kiến" }),
|
|
2142
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2143
|
+
"input",
|
|
2144
|
+
{
|
|
2145
|
+
type: "text",
|
|
2146
|
+
name: "expectedBudget",
|
|
2147
|
+
value: formData.expectedBudget || "",
|
|
2148
|
+
onChange: handleInputChange,
|
|
2149
|
+
className: inputBaseClasses,
|
|
2150
|
+
placeholder: "500,000,000 - 1,000,000,000 VNĐ"
|
|
2151
|
+
}
|
|
2152
|
+
)
|
|
2153
|
+
] }),
|
|
2154
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2155
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: labelClasses, children: t("form.fields.expectedTimeline") || "Thời gian dự kiến" }),
|
|
2156
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2157
|
+
"input",
|
|
2158
|
+
{
|
|
2159
|
+
type: "text",
|
|
2160
|
+
name: "expectedTimeline",
|
|
2161
|
+
value: formData.expectedTimeline || "",
|
|
2162
|
+
onChange: handleInputChange,
|
|
2163
|
+
className: inputBaseClasses,
|
|
2164
|
+
placeholder: "3-6 tháng"
|
|
2165
|
+
}
|
|
2166
|
+
)
|
|
2167
|
+
] })
|
|
2168
|
+
] }),
|
|
2169
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2170
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: labelClasses, children: [
|
|
2171
|
+
t("form.fields.requestTitle") || "Tiêu đề yêu cầu",
|
|
2172
|
+
" *"
|
|
2173
|
+
] }),
|
|
2174
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2175
|
+
"input",
|
|
2176
|
+
{
|
|
2177
|
+
type: "text",
|
|
2178
|
+
name: "requestTitle",
|
|
2179
|
+
value: formData.requestTitle || "",
|
|
2180
|
+
onChange: handleInputChange,
|
|
2181
|
+
onBlur: handleBlur,
|
|
2182
|
+
className: `${inputBaseClasses} ${formErrors.requestTitle ? "border-red-500" : ""}`,
|
|
2183
|
+
placeholder: "Phát triển hệ thống quản lý bán hàng",
|
|
2184
|
+
required: true
|
|
2185
|
+
}
|
|
2186
|
+
),
|
|
2187
|
+
formErrors.requestTitle && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-1 text-sm text-red-500 flex items-center", children: [
|
|
2188
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { size: 14, className: "mr-1" }),
|
|
2189
|
+
formErrors.requestTitle
|
|
2190
|
+
] })
|
|
2191
|
+
] }),
|
|
2192
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2193
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: labelClasses, children: [
|
|
2194
|
+
t("form.fields.requestDescription") || "Mô tả yêu cầu",
|
|
2195
|
+
" *"
|
|
2196
|
+
] }),
|
|
2197
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2198
|
+
"textarea",
|
|
2199
|
+
{
|
|
2200
|
+
name: "requestDescription",
|
|
2201
|
+
value: formData.requestDescription || "",
|
|
2202
|
+
onChange: handleInputChange,
|
|
2203
|
+
onBlur: handleBlur,
|
|
2204
|
+
rows: "5",
|
|
2205
|
+
className: `${inputBaseClasses} resize-none ${formErrors.requestDescription ? "border-red-500" : ""}`,
|
|
2206
|
+
placeholder: "Vui lòng mô tả chi tiết về nhu cầu của bạn...",
|
|
2207
|
+
required: true
|
|
2208
|
+
}
|
|
2209
|
+
),
|
|
2210
|
+
formErrors.requestDescription && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "mt-1 text-sm text-red-500 flex items-center", children: [
|
|
2211
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { size: 14, className: "mr-1" }),
|
|
2212
|
+
formErrors.requestDescription
|
|
2213
|
+
] })
|
|
2214
|
+
] }),
|
|
2215
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
2216
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2217
|
+
"button",
|
|
2218
|
+
{
|
|
2219
|
+
type: "submit",
|
|
2220
|
+
disabled: isSubmitting,
|
|
2221
|
+
className: "flex-1 bg-gradient-to-r from-indigo-600 to-purple-600 text-white py-4 px-6 rounded-xl hover:from-indigo-700 hover:to-purple-700 transition-all transform hover:scale-105 disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none flex items-center justify-center font-semibold shadow-lg",
|
|
2222
|
+
children: isSubmitting ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
2223
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "animate-spin h-5 w-5 mr-2" }),
|
|
2224
|
+
t("form.submitting") || "Đang gửi..."
|
|
2225
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
2226
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Send, { size: 20, className: "mr-2" }),
|
|
2227
|
+
t("form.submit") || "Gửi yêu cầu"
|
|
2228
|
+
] })
|
|
2229
|
+
}
|
|
2230
|
+
),
|
|
2231
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2232
|
+
"button",
|
|
2233
|
+
{
|
|
2234
|
+
type: "button",
|
|
2235
|
+
className: `px-6 py-4 rounded-xl border-2 font-semibold transition-all hover:scale-105 ${isDarkMode ? "border-gray-600 text-gray-300 hover:bg-gray-700" : "border-slate-300 text-slate-700 hover:bg-slate-50"}`,
|
|
2236
|
+
children: [
|
|
2237
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Phone, { size: 20, className: "inline mr-2" }),
|
|
2238
|
+
t("form.callNow") || "Gọi ngay"
|
|
2239
|
+
]
|
|
2240
|
+
}
|
|
2241
|
+
)
|
|
2242
|
+
] }),
|
|
2243
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex items-center space-x-2 text-sm transition-colors duration-200 ${isDarkMode ? "text-gray-400" : "text-slate-600"}`, children: [
|
|
2244
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleCheckBig, { size: 16, className: "text-emerald-500" }),
|
|
2245
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t("form.privacy") || "Cam kết bảo mật thông tin và phản hồi trong 24 giờ" })
|
|
2246
|
+
] })
|
|
2247
|
+
] })
|
|
2248
|
+
] }) }),
|
|
2249
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6", children: [
|
|
2250
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `rounded-2xl p-6 shadow-lg text-white transition-colors duration-200 ${isDarkMode ? "bg-gradient-to-br from-indigo-900 to-purple-900" : "bg-gradient-to-br from-indigo-600 to-purple-600"}`, children: [
|
|
2251
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-bold mb-3", children: t("sidebar.quickContact.title") || "Cần hỗ trợ ngay?" }),
|
|
2252
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-indigo-100 text-sm mb-4", children: t("sidebar.quickContact.description") || "Liên hệ trực tiếp để được tư vấn nhanh chóng" }),
|
|
2253
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
|
|
2254
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2255
|
+
"a",
|
|
2256
|
+
{
|
|
2257
|
+
href: "tel:19005588",
|
|
2258
|
+
className: "flex items-center justify-center w-full bg-white/20 backdrop-blur-sm hover:bg-white/30 py-3 rounded-xl transition-all font-semibold",
|
|
2259
|
+
children: [
|
|
2260
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Phone, { size: 18, className: "mr-2" }),
|
|
2261
|
+
"1900 5588"
|
|
2262
|
+
]
|
|
2263
|
+
}
|
|
2264
|
+
),
|
|
2265
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "flex items-center justify-center w-full border border-white/30 hover:bg-white/10 py-3 rounded-xl transition-all font-semibold", children: [
|
|
2266
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquare, { size: 18, className: "mr-2" }),
|
|
2267
|
+
"Live Chat"
|
|
2268
|
+
] })
|
|
2269
|
+
] })
|
|
2270
|
+
] }),
|
|
2271
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `rounded-2xl p-6 shadow-lg border transition-colors duration-200 ${isDarkMode ? "bg-gray-800 border-gray-700" : "bg-white border-slate-200"}`, children: [
|
|
2272
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: `font-bold mb-4 transition-colors duration-200 ${isDarkMode ? "text-white" : "text-slate-800"}`, children: t("sidebar.contactInfo.title") || "Thông tin liên hệ" }),
|
|
2273
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
2274
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
2275
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-10 h-10 rounded-lg flex items-center justify-center ${isDarkMode ? "bg-indigo-900/50 text-indigo-400" : "bg-indigo-50 text-indigo-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Phone, { size: 18 }) }),
|
|
2276
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2277
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `font-semibold transition-colors duration-200 ${isDarkMode ? "text-white" : "text-slate-800"}`, children: "1900 5588" }),
|
|
2278
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm transition-colors duration-200 ${isDarkMode ? "text-gray-400" : "text-slate-600"}`, children: "Hotline 24/7" })
|
|
2279
|
+
] })
|
|
2280
|
+
] }),
|
|
2281
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
2282
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-10 h-10 rounded-lg flex items-center justify-center ${isDarkMode ? "bg-emerald-900/50 text-emerald-400" : "bg-emerald-50 text-emerald-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Mail, { size: 18 }) }),
|
|
2283
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2284
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `font-semibold transition-colors duration-200 ${isDarkMode ? "text-white" : "text-slate-800"}`, children: "support@asasystems.vn" }),
|
|
2285
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm transition-colors duration-200 ${isDarkMode ? "text-gray-400" : "text-slate-600"}`, children: "Email hỗ trợ" })
|
|
2286
|
+
] })
|
|
2287
|
+
] }),
|
|
2288
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
2289
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-10 h-10 rounded-lg flex items-center justify-center ${isDarkMode ? "bg-purple-900/50 text-purple-400" : "bg-purple-50 text-purple-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageCircle, { size: 18 }) }),
|
|
2290
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2291
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `font-semibold transition-colors duration-200 ${isDarkMode ? "text-white" : "text-slate-800"}`, children: "Live Chat" }),
|
|
2292
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm transition-colors duration-200 ${isDarkMode ? "text-gray-400" : "text-slate-600"}`, children: "T2-T6: 8:00-18:00" })
|
|
2293
|
+
] })
|
|
2294
|
+
] })
|
|
2295
|
+
] })
|
|
2296
|
+
] }),
|
|
2297
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `rounded-2xl p-6 shadow-lg border transition-colors duration-200 ${isDarkMode ? "bg-gray-800 border-gray-700" : "bg-white border-slate-200"}`, children: [
|
|
2298
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: `font-bold mb-4 transition-colors duration-200 ${isDarkMode ? "text-white" : "text-slate-800"}`, children: t("sidebar.faq.title") || "Câu hỏi thường gặp" }),
|
|
2299
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
|
|
2300
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `p-3 rounded-lg transition-colors duration-200 ${isDarkMode ? "bg-gray-700" : "bg-slate-50"}`, children: [
|
|
2301
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `font-medium text-sm transition-colors duration-200 ${isDarkMode ? "text-white" : "text-slate-800"}`, children: t("sidebar.faq.responseTime.question") || "Thời gian phản hồi?" }),
|
|
2302
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm mt-1 transition-colors duration-200 ${isDarkMode ? "text-gray-400" : "text-slate-600"}`, children: t("sidebar.faq.responseTime.answer") || "Trong vòng 24 giờ làm việc" })
|
|
2303
|
+
] }),
|
|
2304
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `p-3 rounded-lg transition-colors duration-200 ${isDarkMode ? "bg-gray-700" : "bg-slate-50"}`, children: [
|
|
2305
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `font-medium text-sm transition-colors duration-200 ${isDarkMode ? "text-white" : "text-slate-800"}`, children: t("sidebar.faq.consultationFree.question") || "Tư vấn có miễn phí?" }),
|
|
2306
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm mt-1 transition-colors duration-200 ${isDarkMode ? "text-gray-400" : "text-slate-600"}`, children: t("sidebar.faq.consultationFree.answer") || "Hoàn toàn miễn phí" })
|
|
2307
|
+
] })
|
|
2308
|
+
] })
|
|
2309
|
+
] })
|
|
2310
|
+
] })
|
|
2311
|
+
] }) }) });
|
|
2312
|
+
};
|
|
2313
|
+
const ContactInfoSection = ({ data, t, isDarkMode }) => {
|
|
2314
|
+
const contactData = (data == null ? void 0 : data.sectionDataBindingItems) || [];
|
|
2315
|
+
if (!contactData.length) return null;
|
|
2316
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: `py-16 ${isDarkMode ? "bg-gray-900" : "bg-slate-50"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
|
|
2317
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center mb-12", children: [
|
|
2318
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `inline-flex items-center px-4 py-2 rounded-full text-sm font-semibold mb-4 ${isDarkMode ? "bg-indigo-900/50 text-indigo-300" : "bg-indigo-50 text-indigo-700"}`, children: [
|
|
2319
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(User, { size: 16, className: "mr-2" }),
|
|
2320
|
+
t("contact.team.badge") || "Đội ngũ hỗ trợ"
|
|
2321
|
+
] }),
|
|
2322
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: `text-3xl lg:text-4xl font-bold mb-4 ${isDarkMode ? "text-white" : "text-slate-800"}`, children: [
|
|
2323
|
+
t("contact.team.title") || "Liên hệ với đội ngũ",
|
|
2324
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block bg-gradient-to-r from-indigo-600 to-purple-600 bg-clip-text text-transparent", children: t("contact.team.subtitle") || "chuyên nghiệp của chúng tôi" })
|
|
2325
|
+
] }),
|
|
2326
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-lg max-w-3xl mx-auto ${isDarkMode ? "text-gray-300" : "text-slate-600"}`, children: t("contact.team.description") || "Chúng tôi luôn sẵn sàng hỗ trợ bạn với đội ngũ chuyên nghiệp và giàu kinh nghiệm" })
|
|
2327
|
+
] }),
|
|
2328
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid md:grid-cols-2 lg:grid-cols-3 gap-8", children: contactData.map((contact, index2) => {
|
|
2329
|
+
var _a;
|
|
2330
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2331
|
+
"div",
|
|
2332
|
+
{
|
|
2333
|
+
className: `rounded-2xl p-8 shadow-lg transition-all duration-300 hover:shadow-xl hover:-translate-y-1 border ${isDarkMode ? "bg-gray-800 border-gray-700" : "bg-white border-slate-200"}`,
|
|
2334
|
+
children: [
|
|
2335
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center mb-6", children: [
|
|
2336
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-20 h-20 rounded-full mx-auto mb-4 flex items-center justify-center text-2xl font-bold text-white bg-gradient-to-br from-indigo-500 to-purple-600", children: ((_a = contact.data.name) == null ? void 0 : _a.charAt(0)) || "A" }),
|
|
2337
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: `text-xl font-bold mb-2 ${isDarkMode ? "text-white" : "text-slate-800"}`, children: contact.data.name }),
|
|
2338
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `inline-block px-3 py-1 rounded-full text-sm font-semibold ${isDarkMode ? "bg-indigo-900/50 text-indigo-300" : "bg-indigo-50 text-indigo-700"}`, children: contact.data.position })
|
|
2339
|
+
] }),
|
|
2340
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
|
|
2341
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2342
|
+
"a",
|
|
2343
|
+
{
|
|
2344
|
+
href: `tel:${contact.data.phone}`,
|
|
2345
|
+
className: `flex items-center p-3 rounded-xl transition-all hover:scale-105 ${isDarkMode ? "bg-gray-700 hover:bg-gray-600" : "bg-slate-50 hover:bg-slate-100"} group`,
|
|
2346
|
+
children: [
|
|
2347
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-10 h-10 rounded-lg flex items-center justify-center mr-3 group-hover:scale-110 transition-transform ${isDarkMode ? "bg-green-900/50 text-green-400" : "bg-green-50 text-green-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Phone, { size: 18 }) }),
|
|
2348
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
|
|
2349
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-medium ${isDarkMode ? "text-gray-400" : "text-slate-500"}`, children: t("contact.info.phone") || "Điện thoại" }),
|
|
2350
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `font-semibold ${isDarkMode ? "text-white" : "text-slate-800"}`, children: contact.data.phone })
|
|
2351
|
+
] })
|
|
2352
|
+
]
|
|
2353
|
+
}
|
|
2354
|
+
),
|
|
2355
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2356
|
+
"a",
|
|
2357
|
+
{
|
|
2358
|
+
href: `mailto:${contact.data.email}`,
|
|
2359
|
+
className: `flex items-center p-3 rounded-xl transition-all hover:scale-105 ${isDarkMode ? "bg-gray-700 hover:bg-gray-600" : "bg-slate-50 hover:bg-slate-100"} group`,
|
|
2360
|
+
children: [
|
|
2361
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-10 h-10 rounded-lg flex items-center justify-center mr-3 group-hover:scale-110 transition-transform ${isDarkMode ? "bg-indigo-900/50 text-indigo-400" : "bg-indigo-50 text-indigo-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Mail, { size: 18 }) }),
|
|
2362
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
|
|
2363
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-medium ${isDarkMode ? "text-gray-400" : "text-slate-500"}`, children: "Email" }),
|
|
2364
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `font-semibold ${isDarkMode ? "text-white" : "text-slate-800"}`, children: contact.data.email })
|
|
2365
|
+
] })
|
|
2366
|
+
]
|
|
2367
|
+
}
|
|
2368
|
+
),
|
|
2369
|
+
contact.data.workingHours && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex items-center p-3 rounded-xl ${isDarkMode ? "bg-gray-700" : "bg-slate-50"}`, children: [
|
|
2370
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-10 h-10 rounded-lg flex items-center justify-center mr-3 ${isDarkMode ? "bg-purple-900/50 text-purple-400" : "bg-purple-50 text-purple-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Clock, { size: 18 }) }),
|
|
2371
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
|
|
2372
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-sm font-medium ${isDarkMode ? "text-gray-400" : "text-slate-500"}`, children: t("contact.info.workingHours") || "Giờ làm việc" }),
|
|
2373
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `font-semibold ${isDarkMode ? "text-white" : "text-slate-800"}`, children: contact.data.workingHours || t("contact.info.defaultWorkingHours") || "T2-T6: 8:00-18:00" })
|
|
2374
|
+
] })
|
|
2375
|
+
] })
|
|
2376
|
+
] }),
|
|
2377
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "w-full py-3 px-4 rounded-xl font-semibold transition-all transform hover:scale-105 bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700 text-white shadow-lg", children: t("contact.buttons.contactNow") || "Liên hệ ngay" }) })
|
|
2378
|
+
]
|
|
2379
|
+
},
|
|
2380
|
+
contact.id || index2
|
|
2381
|
+
);
|
|
2382
|
+
}) })
|
|
2383
|
+
] }) });
|
|
2384
|
+
};
|
|
2385
|
+
const ContactListAutoSection = ({ data, t, isDarkMode, getContactList }) => {
|
|
2386
|
+
const [contacts, setContacts] = useState([]);
|
|
2387
|
+
const [loading, setLoading] = useState(true);
|
|
2388
|
+
const [error, setError] = useState(null);
|
|
2389
|
+
useEffect(() => {
|
|
2390
|
+
loadContacts();
|
|
2391
|
+
}, []);
|
|
2392
|
+
const loadContacts = () => __async(null, null, function* () {
|
|
2393
|
+
try {
|
|
2394
|
+
setLoading(true);
|
|
2395
|
+
const result = yield getContactList();
|
|
2396
|
+
if (result.success) {
|
|
2397
|
+
setContacts(result.data || []);
|
|
2398
|
+
} else {
|
|
2399
|
+
setError(result.error);
|
|
2400
|
+
}
|
|
2401
|
+
} catch (err) {
|
|
2402
|
+
console.error("Error loading contacts:", err);
|
|
2403
|
+
setError(t("contactList.error.loadData") || "Có lỗi xảy ra khi tải danh sách liên hệ");
|
|
2404
|
+
} finally {
|
|
2405
|
+
setLoading(false);
|
|
2406
|
+
}
|
|
2407
|
+
});
|
|
2408
|
+
if (loading) {
|
|
2409
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `py-16 px-5 text-center ${isDarkMode ? "bg-gray-900" : "bg-gray-50"}`, children: [
|
|
2410
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `inline-block w-10 h-10 border-4 ${isDarkMode ? "border-gray-600 border-t-blue-500" : "border-gray-300 border-t-blue-500"} rounded-full animate-spin` }),
|
|
2411
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `mt-4 ${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: t("contactList.status.loading") || "Đang tải danh sách liên hệ..." })
|
|
2412
|
+
] });
|
|
2413
|
+
}
|
|
2414
|
+
if (error) {
|
|
2415
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `py-16 px-5 text-center ${isDarkMode ? "bg-gray-900" : "bg-gray-50"}`, children: [
|
|
2416
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${isDarkMode ? "text-red-400" : "text-red-500"} text-base mb-2`, children: [
|
|
2417
|
+
"⚠️ ",
|
|
2418
|
+
t("contactList.error.title") || "Lỗi tải dữ liệu"
|
|
2419
|
+
] }),
|
|
2420
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: error })
|
|
2421
|
+
] });
|
|
2422
|
+
}
|
|
2423
|
+
if (!contacts || contacts.length === 0) {
|
|
2424
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `py-16 px-5 text-center ${isDarkMode ? "bg-gray-900" : "bg-gray-50"}`, children: [
|
|
2425
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-5xl mb-5", children: "📞" }),
|
|
2426
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: `${isDarkMode ? "text-gray-400" : "text-gray-600"} mb-2`, children: t("contactList.status.noData.title") || "Chưa có thông tin liên hệ" }),
|
|
2427
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `${isDarkMode ? "text-gray-500" : "text-gray-500"}`, children: t("contactList.status.noData.description") || "Danh sách liên hệ sẽ hiển thị tại đây" })
|
|
2428
|
+
] });
|
|
2429
|
+
}
|
|
2430
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: `py-20 ${isDarkMode ? "bg-gray-900" : "bg-gray-50"} transition-colors duration-300`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-6xl mx-auto px-5", children: [
|
|
2431
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center mb-16", children: [
|
|
2432
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: `text-4xl font-bold ${isDarkMode ? "text-white" : "text-gray-900"} mb-4`, children: t("contactList.header.title") || "Thông Tin Liên Hệ" }),
|
|
2433
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-lg ${isDarkMode ? "text-gray-400" : "text-gray-600"} max-w-2xl mx-auto`, children: t("contactList.header.description") || "Đội ngũ chuyên nghiệp của chúng tôi luôn sẵn sàng hỗ trợ bạn" })
|
|
2434
|
+
] }),
|
|
2435
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mt-10", children: contacts.map((contact, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(ContactCard, { contact, t, isDarkMode }, contact.id || index2)) })
|
|
2436
|
+
] }) });
|
|
2437
|
+
};
|
|
2438
|
+
const ContactCard = ({ contact, t, isDarkMode }) => {
|
|
2439
|
+
var _a, _b;
|
|
2440
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
2441
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2442
|
+
"div",
|
|
2443
|
+
{
|
|
2444
|
+
className: `
|
|
2445
|
+
${isDarkMode ? "bg-gray-800 border-gray-700" : "bg-white border-gray-200"} rounded-2xl p-8 border cursor-pointer transition-all duration-300
|
|
2446
|
+
${isHovered ? `shadow-xl ${isDarkMode ? "shadow-gray-900/40" : "shadow-gray-500/20"} -translate-y-2` : `shadow-lg ${isDarkMode ? "shadow-gray-900/20" : "shadow-gray-500/10"}`}
|
|
2447
|
+
`,
|
|
2448
|
+
onMouseEnter: () => setIsHovered(true),
|
|
2449
|
+
onMouseLeave: () => setIsHovered(false),
|
|
2450
|
+
children: [
|
|
2451
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mb-6", children: [
|
|
2452
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-15 h-15 rounded-full ${isDarkMode ? "bg-blue-600" : "bg-blue-500"} flex items-center justify-center text-white text-2xl font-bold mr-4`, children: ((_b = (_a = contact.name) == null ? void 0 : _a.charAt(0)) == null ? void 0 : _b.toUpperCase()) || "?" }),
|
|
2453
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2454
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: `text-xl font-semibold ${isDarkMode ? "text-white" : "text-gray-900"} mb-1`, children: contact.name || t("contactList.card.noName") || "Không có tên" }),
|
|
2455
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-base ${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: contact.position || t("contactList.card.noPosition") || "Chưa có chức vụ" })
|
|
2456
|
+
] })
|
|
2457
|
+
] }),
|
|
2458
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2459
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2460
|
+
ContactInfo,
|
|
2461
|
+
{
|
|
2462
|
+
icon: "📧",
|
|
2463
|
+
label: t("contactList.card.email") || "Email",
|
|
2464
|
+
value: contact.email,
|
|
2465
|
+
href: `mailto:${contact.email}`
|
|
2466
|
+
}
|
|
2467
|
+
),
|
|
2468
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2469
|
+
ContactInfo,
|
|
2470
|
+
{
|
|
2471
|
+
icon: "📱",
|
|
2472
|
+
label: t("contactList.card.phone") || "Điện thoại",
|
|
2473
|
+
value: contact.phone,
|
|
2474
|
+
href: `tel:${contact.phone}`
|
|
2475
|
+
}
|
|
2476
|
+
)
|
|
2477
|
+
] })
|
|
2478
|
+
]
|
|
2479
|
+
}
|
|
2480
|
+
);
|
|
2481
|
+
};
|
|
2482
|
+
const ContactInfo = ({ icon, label, value, href, isDarkMode }) => {
|
|
2483
|
+
if (!value) return null;
|
|
2484
|
+
const content = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex items-center py-3 border-b ${isDarkMode ? "border-gray-600" : "border-gray-100"} last:border-b-0`, children: [
|
|
2485
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lg mr-3 w-6 text-center", children: icon }),
|
|
2486
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
|
|
2487
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `text-sm ${isDarkMode ? "text-gray-400" : "text-gray-600"} mb-0.5`, children: label }),
|
|
2488
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `text-base font-medium ${href ? `${isDarkMode ? "text-blue-400 hover:text-blue-300" : "text-blue-500 hover:text-blue-600"}` : `${isDarkMode ? "text-white" : "text-gray-900"}`} transition-colors duration-200`, children: value })
|
|
2489
|
+
] })
|
|
2490
|
+
] });
|
|
2491
|
+
if (href) {
|
|
2492
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href, className: `no-underline text-inherit block ${isDarkMode ? "hover:bg-gray-700/50" : "hover:bg-gray-50"} rounded-lg -mx-2 px-2 transition-colors duration-200`, children: content });
|
|
2493
|
+
}
|
|
2494
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "-mx-2 px-2", children: content });
|
|
2495
|
+
};
|
|
2496
|
+
const CustomerFeedbackAutoSection = ({ data, t, isDarkMode, loadCustomerFeedback }) => {
|
|
2497
|
+
const [feedbacks, setFeedbacks] = useState([]);
|
|
2498
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
2499
|
+
useEffect(() => {
|
|
2500
|
+
const fetchData = () => __async(null, null, function* () {
|
|
2501
|
+
const res = yield loadCustomerFeedback();
|
|
2502
|
+
if (res.success) {
|
|
2503
|
+
setFeedbacks(Array.isArray(res.data) ? res.data : []);
|
|
2504
|
+
} else {
|
|
2505
|
+
setFeedbacks([]);
|
|
2506
|
+
}
|
|
2507
|
+
});
|
|
2508
|
+
fetchData();
|
|
2509
|
+
}, []);
|
|
2510
|
+
useEffect(() => {
|
|
2511
|
+
if (feedbacks.length > 1) {
|
|
2512
|
+
const interval = setInterval(() => {
|
|
2513
|
+
setCurrentIndex((prev) => (prev + 1) % feedbacks.length);
|
|
2514
|
+
}, 5e3);
|
|
2515
|
+
return () => clearInterval(interval);
|
|
2516
|
+
}
|
|
2517
|
+
}, [feedbacks.length]);
|
|
2518
|
+
useEffect(() => {
|
|
2519
|
+
if (currentIndex >= feedbacks.length) {
|
|
2520
|
+
setCurrentIndex(0);
|
|
2521
|
+
}
|
|
2522
|
+
}, [feedbacks.length, currentIndex]);
|
|
2523
|
+
if (!feedbacks.length) {
|
|
2524
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2525
|
+
"section",
|
|
2526
|
+
{
|
|
2527
|
+
className: `py-20 transition-colors duration-200 ${isDarkMode ? "bg-gray-700" : "bg-gray-50"}`,
|
|
2528
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center", children: [
|
|
2529
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2530
|
+
"div",
|
|
2531
|
+
{
|
|
2532
|
+
className: `w-24 h-24 mx-auto mb-6 rounded-full flex items-center justify-center ${isDarkMode ? "bg-gray-800" : "bg-gray-200"}`,
|
|
2533
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2534
|
+
"svg",
|
|
2535
|
+
{
|
|
2536
|
+
className: `w-12 h-12 ${isDarkMode ? "text-gray-600" : "text-gray-400"}`,
|
|
2537
|
+
fill: "none",
|
|
2538
|
+
stroke: "currentColor",
|
|
2539
|
+
viewBox: "0 0 24 24",
|
|
2540
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2541
|
+
"path",
|
|
2542
|
+
{
|
|
2543
|
+
strokeLinecap: "round",
|
|
2544
|
+
strokeLinejoin: "round",
|
|
2545
|
+
strokeWidth: 2,
|
|
2546
|
+
d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"
|
|
2547
|
+
}
|
|
2548
|
+
)
|
|
2549
|
+
}
|
|
2550
|
+
)
|
|
2551
|
+
}
|
|
2552
|
+
),
|
|
2553
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2554
|
+
"h3",
|
|
2555
|
+
{
|
|
2556
|
+
className: `text-xl font-semibold mb-4 ${isDarkMode ? "text-white" : "text-gray-900"}`,
|
|
2557
|
+
children: t("customerFeedback.emptyTitle") || "Chưa có phản hồi từ khách hàng"
|
|
2558
|
+
}
|
|
2559
|
+
),
|
|
2560
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2561
|
+
"p",
|
|
2562
|
+
{
|
|
2563
|
+
className: `text-lg ${isDarkMode ? "text-gray-300" : "text-gray-600"}`,
|
|
2564
|
+
children: t("customerFeedback.emptyDescription") || "Các phản hồi từ khách hàng sẽ được hiển thị tại đây."
|
|
2565
|
+
}
|
|
2566
|
+
)
|
|
2567
|
+
] })
|
|
2568
|
+
}
|
|
2569
|
+
);
|
|
2570
|
+
}
|
|
2571
|
+
const currentFeedback = feedbacks[currentIndex];
|
|
2572
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2573
|
+
"section",
|
|
2574
|
+
{
|
|
2575
|
+
className: `py-20 transition-colors duration-200 ${isDarkMode ? "bg-gray-700" : "bg-gray-50"}`,
|
|
2576
|
+
children: [
|
|
2577
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center", children: [
|
|
2578
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2579
|
+
"div",
|
|
2580
|
+
{
|
|
2581
|
+
className: `inline-block px-4 py-2 rounded-full text-sm font-semibold mb-4 ${isDarkMode ? "bg-indigo-900/50 text-indigo-300 border border-indigo-800" : "bg-indigo-100 text-indigo-800"}`,
|
|
2582
|
+
children: [
|
|
2583
|
+
"💬 ",
|
|
2584
|
+
t("customerFeedback.badge") || "Phản hồi khách hàng"
|
|
2585
|
+
]
|
|
2586
|
+
}
|
|
2587
|
+
),
|
|
2588
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2589
|
+
"h2",
|
|
2590
|
+
{
|
|
2591
|
+
className: `text-3xl lg:text-4xl font-bold mb-8 transition-colors duration-200 ${isDarkMode ? "text-white" : "text-gray-900"}`,
|
|
2592
|
+
children: [
|
|
2593
|
+
t("customerFeedback.titlelanding") || "Khách hàng nói gì",
|
|
2594
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block bg-gradient-to-r from-indigo-600 to-purple-600 bg-clip-text text-transparent", children: t("customerFeedback.subtitle") || "về chúng tôi" })
|
|
2595
|
+
]
|
|
2596
|
+
}
|
|
2597
|
+
),
|
|
2598
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
|
|
2599
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2600
|
+
"div",
|
|
2601
|
+
{
|
|
2602
|
+
className: `p-6 rounded-2xl transition-all duration-500 transform ${isDarkMode ? "bg-gray-800/80 backdrop-blur-sm border border-gray-700" : "bg-white shadow-lg"}`,
|
|
2603
|
+
children: [
|
|
2604
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2605
|
+
"blockquote",
|
|
2606
|
+
{
|
|
2607
|
+
className: `text-lg lg:text-xl italic mb-6 animate-fadeIn transition-colors duration-200 leading-relaxed ${isDarkMode ? "text-gray-300" : "text-gray-700"}`,
|
|
2608
|
+
children: [
|
|
2609
|
+
'"',
|
|
2610
|
+
currentFeedback.content,
|
|
2611
|
+
'"'
|
|
2612
|
+
]
|
|
2613
|
+
}
|
|
2614
|
+
),
|
|
2615
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center space-x-4 animate-fadeIn", children: [
|
|
2616
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-3xl", children: "👤" }),
|
|
2617
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-left", children: [
|
|
2618
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2619
|
+
"div",
|
|
2620
|
+
{
|
|
2621
|
+
className: `font-bold text-base transition-colors duration-200 ${isDarkMode ? "text-white" : "text-gray-900"}`,
|
|
2622
|
+
children: currentFeedback.customerName
|
|
2623
|
+
}
|
|
2624
|
+
),
|
|
2625
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-blue-600 font-medium text-sm", children: currentFeedback.customerTitle }),
|
|
2626
|
+
currentFeedback.customerCompany && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2627
|
+
"div",
|
|
2628
|
+
{
|
|
2629
|
+
className: `text-xs transition-colors duration-200 ${isDarkMode ? "text-gray-400" : "text-gray-600"}`,
|
|
2630
|
+
children: currentFeedback.customerCompany
|
|
2631
|
+
}
|
|
2632
|
+
)
|
|
2633
|
+
] })
|
|
2634
|
+
] })
|
|
2635
|
+
]
|
|
2636
|
+
},
|
|
2637
|
+
currentIndex
|
|
2638
|
+
),
|
|
2639
|
+
feedbacks.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-center space-x-2 mt-4", children: feedbacks.map((_, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2640
|
+
"button",
|
|
2641
|
+
{
|
|
2642
|
+
onClick: () => setCurrentIndex(index2),
|
|
2643
|
+
className: `w-2.5 h-2.5 rounded-full transition-all duration-300 ${index2 === currentIndex ? "bg-blue-600" : isDarkMode ? "bg-gray-600 hover:bg-gray-500" : "bg-gray-300 hover:bg-gray-400"}`,
|
|
2644
|
+
"aria-label": t("customerFeedback.switchToFeedback", { number: index2 + 1 }) || `Chuyển đến phản hồi ${index2 + 1}`
|
|
2645
|
+
},
|
|
2646
|
+
index2
|
|
2647
|
+
)) })
|
|
2648
|
+
] })
|
|
2649
|
+
] }),
|
|
2650
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("style", { jsx: true, children: `
|
|
2651
|
+
.animate-fadeIn {
|
|
2652
|
+
animation: fadeIn 0.5s ease-in-out;
|
|
2653
|
+
}
|
|
2654
|
+
@keyframes fadeIn {
|
|
2655
|
+
from {
|
|
2656
|
+
opacity: 0;
|
|
2657
|
+
transform: translateY(10px);
|
|
2658
|
+
}
|
|
2659
|
+
to {
|
|
2660
|
+
opacity: 1;
|
|
2661
|
+
transform: translateY(0);
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
` })
|
|
2665
|
+
]
|
|
2666
|
+
}
|
|
2667
|
+
);
|
|
2668
|
+
};
|
|
2669
|
+
const ProductListSection = ({ data, t, isDarkMode, getProductList }) => {
|
|
2670
|
+
const [products, setProducts] = useState([]);
|
|
2671
|
+
const [loading, setLoading] = useState(true);
|
|
2672
|
+
const [error, setError] = useState(null);
|
|
2673
|
+
useEffect(() => {
|
|
2674
|
+
const fetchProducts = () => __async(null, null, function* () {
|
|
2675
|
+
try {
|
|
2676
|
+
setLoading(true);
|
|
2677
|
+
const result = yield getProductList();
|
|
2678
|
+
if (result.success) {
|
|
2679
|
+
setProducts(result.data || []);
|
|
2680
|
+
} else {
|
|
2681
|
+
setError(result.error || t("productList.errors.loadFailed"));
|
|
2682
|
+
}
|
|
2683
|
+
} catch (err) {
|
|
2684
|
+
console.error("Error fetching products:", err);
|
|
2685
|
+
setError(t("productList.errors.loadError"));
|
|
2686
|
+
} finally {
|
|
2687
|
+
setLoading(false);
|
|
2688
|
+
}
|
|
2689
|
+
});
|
|
2690
|
+
fetchProducts();
|
|
2691
|
+
}, [t]);
|
|
2692
|
+
if (loading) {
|
|
2693
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `py-16 px-5 text-center ${isDarkMode ? "bg-gray-900" : "bg-gray-50"}`, children: [
|
|
2694
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `inline-block w-10 h-10 border-4 ${isDarkMode ? "border-gray-600 border-t-blue-400" : "border-gray-300 border-t-blue-500"} rounded-full animate-spin` }),
|
|
2695
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `mt-2.5 text-base ${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: t("productList.loading") })
|
|
2696
|
+
] });
|
|
2697
|
+
}
|
|
2698
|
+
if (error) {
|
|
2699
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `py-16 px-5 text-center ${isDarkMode ? "bg-gray-900" : "bg-gray-50"}`, children: [
|
|
2700
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-red-500 text-5xl mb-4", children: "⚠️" }),
|
|
2701
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-red-500 text-base m-0", children: error })
|
|
2702
|
+
] });
|
|
2703
|
+
}
|
|
2704
|
+
if (!products || products.length === 0) {
|
|
2705
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `py-16 px-5 text-center ${isDarkMode ? "bg-gray-900" : "bg-gray-50"}`, children: [
|
|
2706
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `text-5xl mb-4 ${isDarkMode ? "text-gray-400" : "text-gray-500"}`, children: "📦" }),
|
|
2707
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `text-base m-0 ${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: t("productList.noProducts") })
|
|
2708
|
+
] });
|
|
2709
|
+
}
|
|
2710
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `py-16 px-5 transition-colors duration-300 ${isDarkMode ? "bg-gray-900" : "bg-gray-50"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "max-w-6xl mx-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-8 items-start", children: products.map((product, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(ProductCard, { product, t, isDarkMode }, product.id || index2)) }) }) });
|
|
2711
|
+
};
|
|
2712
|
+
const ProductCard = ({ product, t, isDarkMode }) => {
|
|
2713
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2714
|
+
const [activeTab, setActiveTab] = useState("overview");
|
|
2715
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
2716
|
+
const mainImage = ((_b = (_a = product.images) == null ? void 0 : _a.find((img) => img.isMain)) == null ? void 0 : _b.imageUrl) || ((_d = (_c = product.images) == null ? void 0 : _c[0]) == null ? void 0 : _d.imageUrl) || "/placeholder-product.png";
|
|
2717
|
+
const tabs = [
|
|
2718
|
+
{ id: "overview", label: t("productCard.tabs.overview"), count: null },
|
|
2719
|
+
{ id: "features", label: t("productCard.tabs.features"), count: ((_e = product.features) == null ? void 0 : _e.length) || 0 },
|
|
2720
|
+
{ id: "contacts", label: t("productCard.tabs.contacts"), count: ((_f = product.contacts) == null ? void 0 : _f.length) || 0 },
|
|
2721
|
+
{ id: "downloads", label: t("productCard.tabs.downloads"), count: ((_g = product.productDownloads) == null ? void 0 : _g.length) || 0 }
|
|
2722
|
+
];
|
|
2723
|
+
const renderOverview = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-5", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2724
|
+
"div",
|
|
2725
|
+
{
|
|
2726
|
+
className: `text-sm leading-relaxed ${isDarkMode ? "text-gray-300" : "text-gray-700"}`,
|
|
2727
|
+
dangerouslySetInnerHTML: {
|
|
2728
|
+
__html: product.overviewContent || product.description || t("productCard.noOverview")
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
) });
|
|
2732
|
+
const renderFeatures = () => {
|
|
2733
|
+
const features = product.features || [];
|
|
2734
|
+
if (features.length === 0) {
|
|
2735
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `p-5 text-center ${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "m-0", children: t("productCard.noFeatures") }) });
|
|
2736
|
+
}
|
|
2737
|
+
const sortedFeatures = [...features].sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
2738
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-5", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-4", children: sortedFeatures.map((feature, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2739
|
+
"div",
|
|
2740
|
+
{
|
|
2741
|
+
className: `p-4 rounded-lg border-l-4 border-blue-500 ${isDarkMode ? "bg-gray-700" : "bg-gray-100"}`,
|
|
2742
|
+
children: [
|
|
2743
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: `m-0 mb-2 text-sm font-bold ${isDarkMode ? "text-white" : "text-gray-900"}`, children: feature.title }),
|
|
2744
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `m-0 text-xs leading-relaxed ${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: feature.description })
|
|
2745
|
+
]
|
|
2746
|
+
},
|
|
2747
|
+
index2
|
|
2748
|
+
)) }) });
|
|
2749
|
+
};
|
|
2750
|
+
const renderContacts = () => {
|
|
2751
|
+
const contacts = product.contacts || [];
|
|
2752
|
+
if (contacts.length === 0) {
|
|
2753
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `p-5 text-center ${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "m-0", children: t("productCard.noContacts") }) });
|
|
2754
|
+
}
|
|
2755
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-5", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-4", children: contacts.map((contact, index2) => {
|
|
2756
|
+
var _a2, _b2;
|
|
2757
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2758
|
+
"div",
|
|
2759
|
+
{
|
|
2760
|
+
className: `p-4 rounded-lg border ${isDarkMode ? "bg-gray-700 border-gray-600" : "bg-gray-100 border-gray-200"}`,
|
|
2761
|
+
children: [
|
|
2762
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center mb-2", children: [
|
|
2763
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-10 h-10 rounded-full flex items-center justify-center mr-3 ${isDarkMode ? "bg-blue-600" : "bg-blue-500"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-bold text-base", children: ((_b2 = (_a2 = contact.name) == null ? void 0 : _a2.charAt(0)) == null ? void 0 : _b2.toUpperCase()) || "?" }) }),
|
|
2764
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2765
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: `m-0 mb-0.5 text-sm font-bold ${isDarkMode ? "text-white" : "text-gray-900"}`, children: contact.name }),
|
|
2766
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `m-0 text-xs ${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: contact.position })
|
|
2767
|
+
] })
|
|
2768
|
+
] }),
|
|
2769
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
2770
|
+
contact.phone && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2771
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-sm ${isDarkMode ? "text-blue-400" : "text-blue-500"}`, children: "📞" }),
|
|
2772
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2773
|
+
"a",
|
|
2774
|
+
{
|
|
2775
|
+
href: `tel:${contact.phone}`,
|
|
2776
|
+
className: `text-xs no-underline hover:underline ${isDarkMode ? "text-blue-400" : "text-blue-500"}`,
|
|
2777
|
+
children: contact.phone
|
|
2778
|
+
}
|
|
2779
|
+
)
|
|
2780
|
+
] }),
|
|
2781
|
+
contact.email && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2782
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-sm ${isDarkMode ? "text-blue-400" : "text-blue-500"}`, children: "✉️" }),
|
|
2783
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2784
|
+
"a",
|
|
2785
|
+
{
|
|
2786
|
+
href: `mailto:${contact.email}`,
|
|
2787
|
+
className: `text-xs no-underline hover:underline ${isDarkMode ? "text-blue-400" : "text-blue-500"}`,
|
|
2788
|
+
children: contact.email
|
|
2789
|
+
}
|
|
2790
|
+
)
|
|
2791
|
+
] })
|
|
2792
|
+
] })
|
|
2793
|
+
]
|
|
2794
|
+
},
|
|
2795
|
+
contact.id || index2
|
|
2796
|
+
);
|
|
2797
|
+
}) }) });
|
|
2798
|
+
};
|
|
2799
|
+
const renderDownloads = () => {
|
|
2800
|
+
const downloads = product.productDownloads || [];
|
|
2801
|
+
if (downloads.length === 0) {
|
|
2802
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `p-5 text-center ${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "m-0", children: t("productCard.noDownloads") }) });
|
|
2803
|
+
}
|
|
2804
|
+
const handleDownload = (fileUrl, title) => {
|
|
2805
|
+
try {
|
|
2806
|
+
const link = document.createElement("a");
|
|
2807
|
+
link.href = fileUrl;
|
|
2808
|
+
link.download = title || "download";
|
|
2809
|
+
link.target = "_blank";
|
|
2810
|
+
document.body.appendChild(link);
|
|
2811
|
+
link.click();
|
|
2812
|
+
document.body.removeChild(link);
|
|
2813
|
+
} catch (error) {
|
|
2814
|
+
console.error("Download error:", error);
|
|
2815
|
+
}
|
|
2816
|
+
};
|
|
2817
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-5", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-3", children: downloads.map((download, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2818
|
+
"div",
|
|
2819
|
+
{
|
|
2820
|
+
onClick: () => handleDownload(download.fileUrl, download.title),
|
|
2821
|
+
className: `p-4 rounded-lg border cursor-pointer flex items-center gap-3 transition-all duration-200 hover:translate-x-1 ${isDarkMode ? "bg-gray-700 border-gray-600 hover:bg-gray-600" : "bg-gray-100 border-gray-200 hover:bg-gray-200"}`,
|
|
2822
|
+
children: [
|
|
2823
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0 ${isDarkMode ? "bg-blue-600" : "bg-blue-500"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-lg", children: "📄" }) }),
|
|
2824
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2825
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: `m-0 mb-1 text-sm font-bold overflow-hidden text-ellipsis whitespace-nowrap ${isDarkMode ? "text-white" : "text-gray-900"}`, children: download.title }),
|
|
2826
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: `m-0 text-xs ${isDarkMode ? "text-gray-400" : "text-gray-600"}`, children: t("productCard.downloadClick") })
|
|
2827
|
+
] }),
|
|
2828
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `flex-shrink-0 text-base ${isDarkMode ? "text-blue-400" : "text-blue-500"}`, children: "⬇️" })
|
|
2829
|
+
]
|
|
2830
|
+
},
|
|
2831
|
+
index2
|
|
2832
|
+
)) }) });
|
|
2833
|
+
};
|
|
2834
|
+
const renderTabContent = () => {
|
|
2835
|
+
switch (activeTab) {
|
|
2836
|
+
case "overview":
|
|
2837
|
+
return renderOverview();
|
|
2838
|
+
case "features":
|
|
2839
|
+
return renderFeatures();
|
|
2840
|
+
case "contacts":
|
|
2841
|
+
return renderContacts();
|
|
2842
|
+
case "downloads":
|
|
2843
|
+
return renderDownloads();
|
|
2844
|
+
default:
|
|
2845
|
+
return null;
|
|
2846
|
+
}
|
|
2847
|
+
};
|
|
2848
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2849
|
+
"div",
|
|
2850
|
+
{
|
|
2851
|
+
className: `
|
|
2852
|
+
rounded-xl overflow-hidden cursor-pointer transition-all duration-300 border
|
|
2853
|
+
${isDarkMode ? "bg-gray-800 border-gray-700" : "bg-white border-gray-200"}
|
|
2854
|
+
${isHovered ? `shadow-xl -translate-y-2 ${isDarkMode ? "shadow-gray-900/40" : "shadow-gray-500/20"}` : `shadow-lg ${isDarkMode ? "shadow-gray-900/20" : "shadow-gray-500/10"}`}
|
|
2855
|
+
`,
|
|
2856
|
+
onMouseEnter: () => setIsHovered(true),
|
|
2857
|
+
onMouseLeave: () => setIsHovered(false),
|
|
2858
|
+
children: [
|
|
2859
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2860
|
+
"div",
|
|
2861
|
+
{
|
|
2862
|
+
className: `relative h-48 bg-cover bg-center ${isDarkMode ? "bg-gray-700" : "bg-gray-200"}`,
|
|
2863
|
+
style: {
|
|
2864
|
+
backgroundImage: `url(${mainImage})`
|
|
2865
|
+
},
|
|
2866
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 via-black/30 to-transparent p-5 text-white", children: [
|
|
2867
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "m-0 mb-2 text-lg font-bold", children: product.name }),
|
|
2868
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "m-0 text-sm opacity-90", children: product.description })
|
|
2869
|
+
] })
|
|
2870
|
+
}
|
|
2871
|
+
),
|
|
2872
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `border-b ${isDarkMode ? "border-gray-600" : "border-gray-200"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex overflow-x-auto", children: tabs.map((tab) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2873
|
+
"button",
|
|
2874
|
+
{
|
|
2875
|
+
onClick: () => setActiveTab(tab.id),
|
|
2876
|
+
className: `
|
|
2877
|
+
flex-1 min-w-[100px] py-4 px-2 border-none text-xs font-medium cursor-pointer transition-all duration-300 flex items-center justify-center gap-1
|
|
2878
|
+
${activeTab === tab.id ? `${isDarkMode ? "bg-blue-600" : "bg-blue-500"} text-white font-bold` : `bg-transparent ${isDarkMode ? "text-gray-400 hover:bg-gray-700" : "text-gray-600 hover:bg-gray-100"}`}
|
|
2879
|
+
`,
|
|
2880
|
+
children: [
|
|
2881
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: tab.label }),
|
|
2882
|
+
tab.count !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `
|
|
2883
|
+
text-xs py-0.5 px-1.5 rounded-full min-w-[18px] text-center
|
|
2884
|
+
${activeTab === tab.id ? "bg-white/20 text-white" : `${isDarkMode ? "bg-gray-600 text-gray-400" : "bg-gray-200 text-gray-600"}`}
|
|
2885
|
+
`, children: tab.count })
|
|
2886
|
+
]
|
|
2887
|
+
},
|
|
2888
|
+
tab.id
|
|
2889
|
+
)) }) }),
|
|
2890
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "min-h-[200px] max-h-[300px] overflow-y-auto", children: renderTabContent() })
|
|
2891
|
+
]
|
|
2892
|
+
}
|
|
2893
|
+
);
|
|
2894
|
+
};
|
|
2895
|
+
const ImageItem = ({ item, index: index2, isDarkMode, t, getObjectUrl: getObjectUrl2 }) => {
|
|
2896
|
+
var _a;
|
|
2897
|
+
const media = (_a = item.medias) == null ? void 0 : _a[0];
|
|
2898
|
+
const getImageUrl = () => {
|
|
2899
|
+
if (!(media == null ? void 0 : media.url)) return null;
|
|
2900
|
+
if (media.url instanceof File) {
|
|
2901
|
+
return URL.createObjectURL(media.url);
|
|
2902
|
+
}
|
|
2903
|
+
if (typeof media.url === "string" && getObjectUrl2) {
|
|
2904
|
+
return getObjectUrl2(media.url);
|
|
2905
|
+
}
|
|
2906
|
+
return media.url;
|
|
2907
|
+
};
|
|
2908
|
+
const imageUrl = getImageUrl();
|
|
2909
|
+
require$$0.useEffect(() => {
|
|
2910
|
+
return () => {
|
|
2911
|
+
if (imageUrl && imageUrl.startsWith("blob:")) {
|
|
2912
|
+
URL.revokeObjectURL(imageUrl);
|
|
2913
|
+
}
|
|
2914
|
+
};
|
|
2915
|
+
}, [imageUrl]);
|
|
2916
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2917
|
+
"div",
|
|
2918
|
+
{
|
|
2919
|
+
style: {
|
|
2920
|
+
borderRadius: "8px",
|
|
2921
|
+
overflow: "hidden",
|
|
2922
|
+
boxShadow: isDarkMode ? "0 4px 8px rgba(0,0,0,0.3)" : "0 4px 8px rgba(0,0,0,0.1)"
|
|
2923
|
+
},
|
|
2924
|
+
children: imageUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2925
|
+
"img",
|
|
2926
|
+
{
|
|
2927
|
+
src: imageUrl,
|
|
2928
|
+
alt: `Image ${index2 + 1}`,
|
|
2929
|
+
style: {
|
|
2930
|
+
width: "100%",
|
|
2931
|
+
height: "250px",
|
|
2932
|
+
objectFit: "cover"
|
|
2933
|
+
},
|
|
2934
|
+
onError: (e) => {
|
|
2935
|
+
e.currentTarget.parentElement.style.display = "none";
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2938
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2939
|
+
"div",
|
|
2940
|
+
{
|
|
2941
|
+
style: {
|
|
2942
|
+
width: "100%",
|
|
2943
|
+
height: "250px",
|
|
2944
|
+
backgroundColor: isDarkMode ? "#374151" : "#f3f4f6",
|
|
2945
|
+
display: "flex",
|
|
2946
|
+
alignItems: "center",
|
|
2947
|
+
justifyContent: "center",
|
|
2948
|
+
color: isDarkMode ? "#9ca3af" : "#6b7280",
|
|
2949
|
+
fontSize: "14px"
|
|
2950
|
+
},
|
|
2951
|
+
children: t("imageSection.noImage") || "No image available"
|
|
2952
|
+
}
|
|
2953
|
+
)
|
|
2954
|
+
},
|
|
2955
|
+
item.id || index2
|
|
2956
|
+
);
|
|
2957
|
+
};
|
|
2958
|
+
const ImageSection = ({ data, t, isDarkMode, getObjectUrl: getObjectUrl2 }) => {
|
|
2959
|
+
const imageItems = useMemo(() => (data == null ? void 0 : data.sectionDataBindingItems) || [], [data]);
|
|
2960
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
|
|
2961
|
+
padding: "40px 20px",
|
|
2962
|
+
backgroundColor: isDarkMode ? "#111827" : "white"
|
|
2963
|
+
}, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { maxWidth: "1200px", margin: "0 auto" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2964
|
+
"div",
|
|
2965
|
+
{
|
|
2966
|
+
style: {
|
|
2967
|
+
display: "grid",
|
|
2968
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(300px, 1fr))",
|
|
2969
|
+
gap: "20px"
|
|
2970
|
+
},
|
|
2971
|
+
children: imageItems.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2972
|
+
ImageItem,
|
|
2973
|
+
{
|
|
2974
|
+
item,
|
|
2975
|
+
index: index2,
|
|
2976
|
+
isDarkMode,
|
|
2977
|
+
t,
|
|
2978
|
+
getObjectUrl: getObjectUrl2
|
|
2979
|
+
},
|
|
2980
|
+
item.id || index2
|
|
2981
|
+
))
|
|
2982
|
+
}
|
|
2983
|
+
) }) });
|
|
2984
|
+
};
|
|
2985
|
+
const SingleImageItem = ({ item, index: index2, isDarkMode }) => {
|
|
2986
|
+
var _a;
|
|
2987
|
+
const media = (_a = item.medias) == null ? void 0 : _a[0];
|
|
2988
|
+
const getImageUrl = () => {
|
|
2989
|
+
if (!(media == null ? void 0 : media.url)) return null;
|
|
2990
|
+
if (media.url instanceof File) {
|
|
2991
|
+
return URL.createObjectURL(media.url);
|
|
2992
|
+
}
|
|
2993
|
+
if (getObjectUrl && typeof media.url === "string") {
|
|
2994
|
+
return getObjectUrl(media.url);
|
|
2995
|
+
}
|
|
2996
|
+
return media.url;
|
|
2997
|
+
};
|
|
2998
|
+
const imageUrl = getImageUrl();
|
|
2999
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3000
|
+
"div",
|
|
3001
|
+
{
|
|
3002
|
+
style: {
|
|
3003
|
+
borderRadius: "12px",
|
|
3004
|
+
overflow: "hidden",
|
|
3005
|
+
boxShadow: isDarkMode ? "0 8px 24px rgba(0,0,0,0.4)" : "0 8px 24px rgba(0,0,0,0.15)",
|
|
3006
|
+
marginBottom: "30px"
|
|
3007
|
+
},
|
|
3008
|
+
children: imageUrl && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3009
|
+
"img",
|
|
3010
|
+
{
|
|
3011
|
+
src: imageUrl,
|
|
3012
|
+
alt: `Single Image ${index2 + 1}`,
|
|
3013
|
+
style: {
|
|
3014
|
+
width: "100%",
|
|
3015
|
+
height: "400px",
|
|
3016
|
+
objectFit: "cover",
|
|
3017
|
+
display: "block"
|
|
3018
|
+
},
|
|
3019
|
+
onError: (e) => {
|
|
3020
|
+
e.currentTarget.style.display = "none";
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
)
|
|
3024
|
+
},
|
|
3025
|
+
item.id || index2
|
|
3026
|
+
);
|
|
3027
|
+
};
|
|
3028
|
+
const ImageSingleSection = ({ data, t, isDarkMode, getObjectUrl: getObjectUrl2 }) => {
|
|
3029
|
+
const imageItems = useMemo(() => (data == null ? void 0 : data.sectionDataBindingItems) || [], [data]);
|
|
3030
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
|
|
3031
|
+
padding: "40px 20px",
|
|
3032
|
+
backgroundColor: isDarkMode ? "#111827" : "white"
|
|
3033
|
+
}, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { maxWidth: "800px", margin: "0 auto" }, children: imageItems.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3034
|
+
SingleImageItem,
|
|
3035
|
+
{
|
|
3036
|
+
item,
|
|
3037
|
+
index: index2,
|
|
3038
|
+
isDarkMode,
|
|
3039
|
+
getObjectUrl: getObjectUrl2
|
|
3040
|
+
},
|
|
3041
|
+
item.id || index2
|
|
3042
|
+
)) }) });
|
|
3043
|
+
};
|
|
3044
|
+
const TextWithTitleSection = ({ section, data, isDarkMode }) => {
|
|
3045
|
+
const textItems = (data == null ? void 0 : data.sectionDataBindingItems) || [];
|
|
3046
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
|
|
3047
|
+
padding: "40px 20px",
|
|
3048
|
+
backgroundColor: isDarkMode ? "#1f2937" : "#f8f9fa",
|
|
3049
|
+
textAlign: "center"
|
|
3050
|
+
}, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { maxWidth: "800px", margin: "0 auto" }, children: textItems.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
3051
|
+
"div",
|
|
3052
|
+
{
|
|
3053
|
+
style: {
|
|
3054
|
+
backgroundColor: isDarkMode ? "#374151" : "white",
|
|
3055
|
+
padding: "30px 20px",
|
|
3056
|
+
marginBottom: "20px",
|
|
3057
|
+
borderRadius: "8px",
|
|
3058
|
+
boxShadow: isDarkMode ? "0 2px 4px rgba(0,0,0,0.3)" : "0 2px 4px rgba(0,0,0,0.1)"
|
|
3059
|
+
},
|
|
3060
|
+
children: [
|
|
3061
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { style: {
|
|
3062
|
+
fontSize: "24px",
|
|
3063
|
+
fontWeight: "bold",
|
|
3064
|
+
color: isDarkMode ? "#f9fafb" : "#1f2937",
|
|
3065
|
+
marginBottom: "16px",
|
|
3066
|
+
lineHeight: "1.3"
|
|
3067
|
+
}, children: item.title }),
|
|
3068
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
|
|
3069
|
+
fontSize: "16px",
|
|
3070
|
+
lineHeight: "1.6",
|
|
3071
|
+
color: isDarkMode ? "#d1d5db" : "#4b5563",
|
|
3072
|
+
textAlign: "left"
|
|
3073
|
+
}, children: item.value })
|
|
3074
|
+
]
|
|
3075
|
+
},
|
|
3076
|
+
item.id || index2
|
|
3077
|
+
)) }) });
|
|
3078
|
+
};
|
|
3079
|
+
const index = {
|
|
3080
|
+
AboutCompanySection,
|
|
3081
|
+
CompanyValues,
|
|
3082
|
+
TimelineSection,
|
|
3083
|
+
PartnerCard,
|
|
3084
|
+
PartnersSection,
|
|
3085
|
+
MilestoneSection,
|
|
3086
|
+
TestimonialsSection,
|
|
3087
|
+
PartnerListCard,
|
|
3088
|
+
PartnerListSection,
|
|
3089
|
+
ContactFormSection,
|
|
3090
|
+
ContactInfoSection,
|
|
3091
|
+
ContactListAutoSection,
|
|
3092
|
+
CustomerFeedbackAutoSection,
|
|
3093
|
+
ProductListSection,
|
|
3094
|
+
ImageSection,
|
|
3095
|
+
ImageSingleSection,
|
|
3096
|
+
TextWithTitleSection
|
|
1038
3097
|
};
|
|
1039
3098
|
export {
|
|
1040
3099
|
AboutCompanySection,
|
|
1041
3100
|
CompanyValues,
|
|
3101
|
+
ContactFormSection,
|
|
3102
|
+
ContactInfoSection,
|
|
3103
|
+
ContactListAutoSection,
|
|
3104
|
+
CustomerFeedbackAutoSection,
|
|
3105
|
+
ImageSection,
|
|
3106
|
+
ImageSingleSection,
|
|
3107
|
+
MilestoneSection,
|
|
1042
3108
|
PartnerCard,
|
|
3109
|
+
PartnerListCard,
|
|
3110
|
+
PartnerListSection,
|
|
1043
3111
|
PartnersSection,
|
|
3112
|
+
ProductListSection,
|
|
3113
|
+
TestimonialsSection,
|
|
3114
|
+
TextWithTitleSection,
|
|
1044
3115
|
TimelineSection,
|
|
1045
3116
|
index as default
|
|
1046
3117
|
};
|