@anker-in/ui 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/demo-room.js +32 -4
- package/dist/demo-room.js.map +1 -1
- package/dist/demo-room.mjs +32 -4
- package/dist/demo-room.mjs.map +1 -1
- package/dist/index.d.mts +43 -6
- package/dist/index.d.ts +43 -6
- package/dist/index.js +219 -135
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +218 -136
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1028,6 +1028,66 @@ function useCreateBooking(client) {
|
|
|
1028
1028
|
createBooking
|
|
1029
1029
|
};
|
|
1030
1030
|
}
|
|
1031
|
+
function useBooking(client, token, locale, options) {
|
|
1032
|
+
const [state, setState] = useState({
|
|
1033
|
+
data: null,
|
|
1034
|
+
loading: true,
|
|
1035
|
+
error: null
|
|
1036
|
+
});
|
|
1037
|
+
const enabled = options?.enabled !== false;
|
|
1038
|
+
useEffect(() => {
|
|
1039
|
+
if (!enabled || !token) return;
|
|
1040
|
+
let cancelled = false;
|
|
1041
|
+
const fetchData = async () => {
|
|
1042
|
+
setState((prev) => ({ ...prev, loading: true, error: null }));
|
|
1043
|
+
try {
|
|
1044
|
+
const data = await client.getBooking(token, locale);
|
|
1045
|
+
if (!cancelled) {
|
|
1046
|
+
setState({ data, loading: false, error: null });
|
|
1047
|
+
}
|
|
1048
|
+
} catch (error) {
|
|
1049
|
+
if (!cancelled) {
|
|
1050
|
+
setState({
|
|
1051
|
+
data: null,
|
|
1052
|
+
loading: false,
|
|
1053
|
+
error: error instanceof ApiError ? error : new ApiError(1006, "Unknown error")
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
fetchData();
|
|
1059
|
+
return () => {
|
|
1060
|
+
cancelled = true;
|
|
1061
|
+
};
|
|
1062
|
+
}, [client, token, locale, enabled]);
|
|
1063
|
+
return state;
|
|
1064
|
+
}
|
|
1065
|
+
function useCancelBooking(client) {
|
|
1066
|
+
const [state, setState] = useState({
|
|
1067
|
+
data: null,
|
|
1068
|
+
loading: false,
|
|
1069
|
+
error: null
|
|
1070
|
+
});
|
|
1071
|
+
const cancelBooking = useCallback(
|
|
1072
|
+
async (token, locale) => {
|
|
1073
|
+
setState({ data: null, loading: true, error: null });
|
|
1074
|
+
try {
|
|
1075
|
+
const result = await client.cancelBooking(token, locale);
|
|
1076
|
+
setState({ data: result, loading: false, error: null });
|
|
1077
|
+
return result;
|
|
1078
|
+
} catch (error) {
|
|
1079
|
+
const apiError = error instanceof ApiError ? error : new ApiError(1006, "Unknown error");
|
|
1080
|
+
setState({ data: null, loading: false, error: apiError });
|
|
1081
|
+
throw apiError;
|
|
1082
|
+
}
|
|
1083
|
+
},
|
|
1084
|
+
[client]
|
|
1085
|
+
);
|
|
1086
|
+
return {
|
|
1087
|
+
...state,
|
|
1088
|
+
cancelBooking
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1031
1091
|
var AntdMobileIsolated = ({
|
|
1032
1092
|
children,
|
|
1033
1093
|
className,
|
|
@@ -1799,11 +1859,39 @@ var DemoRoomApiClient = class {
|
|
|
1799
1859
|
});
|
|
1800
1860
|
}
|
|
1801
1861
|
/**
|
|
1802
|
-
* 根据 token
|
|
1803
|
-
* @param token
|
|
1862
|
+
* 根据 token 获取预约详情(支持多语言)
|
|
1863
|
+
* @param token 预约凭证 (cancel_token)
|
|
1864
|
+
* @param locale 语言偏好(可选,也可以通过 Accept-Language Header)
|
|
1865
|
+
*/
|
|
1866
|
+
async getBooking(token, locale) {
|
|
1867
|
+
const headers = {};
|
|
1868
|
+
if (locale) {
|
|
1869
|
+
headers["Accept-Language"] = locale;
|
|
1870
|
+
}
|
|
1871
|
+
const response = await this.request(
|
|
1872
|
+
`/api/v1/store/bookings/${token}`,
|
|
1873
|
+
{ headers }
|
|
1874
|
+
);
|
|
1875
|
+
return response.booking;
|
|
1876
|
+
}
|
|
1877
|
+
/**
|
|
1878
|
+
* 取消预约(支持多语言邮件通知)
|
|
1879
|
+
* @param token 预约凭证 (cancel_token)
|
|
1880
|
+
* @param locale 语言偏好(可选,用于邮件通知)
|
|
1804
1881
|
*/
|
|
1805
|
-
async
|
|
1806
|
-
|
|
1882
|
+
async cancelBooking(token, locale) {
|
|
1883
|
+
const headers = {};
|
|
1884
|
+
if (locale) {
|
|
1885
|
+
headers["Accept-Language"] = locale;
|
|
1886
|
+
}
|
|
1887
|
+
const response = await this.request(
|
|
1888
|
+
`/api/v1/store/bookings/${token}/cancel`,
|
|
1889
|
+
{
|
|
1890
|
+
method: "POST",
|
|
1891
|
+
headers
|
|
1892
|
+
}
|
|
1893
|
+
);
|
|
1894
|
+
return response.booking;
|
|
1807
1895
|
}
|
|
1808
1896
|
};
|
|
1809
1897
|
function createDemoRoomApi(config) {
|
|
@@ -1849,21 +1937,38 @@ var DemoRoom = ({
|
|
|
1849
1937
|
] });
|
|
1850
1938
|
};
|
|
1851
1939
|
DemoRoom.displayName = "DemoRoom";
|
|
1852
|
-
var
|
|
1940
|
+
var Navigation;
|
|
1941
|
+
var Pagination;
|
|
1942
|
+
var Autoplay;
|
|
1943
|
+
var swiperVersion = "11+";
|
|
1853
1944
|
try {
|
|
1854
|
-
|
|
1945
|
+
const modules = __require("swiper/modules");
|
|
1946
|
+
Navigation = modules.Navigation;
|
|
1947
|
+
Pagination = modules.Pagination;
|
|
1948
|
+
Autoplay = modules.Autoplay;
|
|
1949
|
+
swiperVersion = "11+";
|
|
1855
1950
|
} catch (e) {
|
|
1856
1951
|
try {
|
|
1857
1952
|
const SwiperCore = __require("swiper");
|
|
1858
|
-
|
|
1953
|
+
const SwiperNavigation = __require("swiper/modules/navigation");
|
|
1954
|
+
const SwiperPagination = __require("swiper/modules/pagination");
|
|
1955
|
+
const SwiperAutoplay = __require("swiper/modules/autoplay");
|
|
1956
|
+
const SwiperClass = SwiperCore.default || SwiperCore;
|
|
1957
|
+
if (SwiperClass && SwiperClass.use) {
|
|
1958
|
+
SwiperClass.use([
|
|
1959
|
+
SwiperNavigation.default || SwiperNavigation,
|
|
1960
|
+
SwiperPagination.default || SwiperPagination,
|
|
1961
|
+
SwiperAutoplay.default || SwiperAutoplay
|
|
1962
|
+
]);
|
|
1963
|
+
}
|
|
1964
|
+
Navigation = SwiperNavigation.default || SwiperNavigation;
|
|
1965
|
+
Pagination = SwiperPagination.default || SwiperPagination;
|
|
1966
|
+
Autoplay = SwiperAutoplay.default || SwiperAutoplay;
|
|
1967
|
+
swiperVersion = "8";
|
|
1859
1968
|
} catch (e2) {
|
|
1860
|
-
console.warn("Failed to load swiper modules");
|
|
1861
|
-
swiperModules = {};
|
|
1969
|
+
console.warn("Failed to load swiper modules:", e2);
|
|
1862
1970
|
}
|
|
1863
1971
|
}
|
|
1864
|
-
var Navigation = swiperModules.Navigation;
|
|
1865
|
-
var Pagination = swiperModules.Pagination;
|
|
1866
|
-
var Autoplay = swiperModules.Autoplay;
|
|
1867
1972
|
if (typeof window !== "undefined") {
|
|
1868
1973
|
try {
|
|
1869
1974
|
__require("swiper/css");
|
|
@@ -2063,7 +2168,7 @@ var DemoRoomDetail = ({
|
|
|
2063
2168
|
/* @__PURE__ */ jsx("div", { className: "relative h-[400px] rounded-2xl overflow-hidden", children: images.length > 0 ? /* @__PURE__ */ jsx(
|
|
2064
2169
|
Swiper,
|
|
2065
2170
|
{
|
|
2066
|
-
modules: [Navigation, Pagination, Autoplay],
|
|
2171
|
+
...swiperVersion === "11+" && Navigation && Pagination && Autoplay ? { modules: [Navigation, Pagination, Autoplay] } : {},
|
|
2067
2172
|
spaceBetween: 0,
|
|
2068
2173
|
slidesPerView: 1,
|
|
2069
2174
|
navigation: true,
|
|
@@ -2210,7 +2315,7 @@ var QuestionnaireForm = ({
|
|
|
2210
2315
|
}
|
|
2211
2316
|
);
|
|
2212
2317
|
case "radio":
|
|
2213
|
-
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question
|
|
2318
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question?.options?.map((option) => /* @__PURE__ */ jsxs(
|
|
2214
2319
|
"label",
|
|
2215
2320
|
{
|
|
2216
2321
|
className: "flex items-center gap-3 cursor-pointer group",
|
|
@@ -2232,7 +2337,7 @@ var QuestionnaireForm = ({
|
|
|
2232
2337
|
option.value || option.label
|
|
2233
2338
|
)) });
|
|
2234
2339
|
case "checkbox":
|
|
2235
|
-
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question
|
|
2340
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question?.options?.map((option) => {
|
|
2236
2341
|
const optionValue = option.value || option.label;
|
|
2237
2342
|
const isChecked = (responses[questionId] || []).includes(
|
|
2238
2343
|
optionValue
|
|
@@ -2291,7 +2396,7 @@ var QuestionnaireForm = ({
|
|
|
2291
2396
|
}
|
|
2292
2397
|
};
|
|
2293
2398
|
return /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: [
|
|
2294
|
-
questions
|
|
2399
|
+
questions?.map((question) => {
|
|
2295
2400
|
const questionId = getQuestionId(question);
|
|
2296
2401
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
2297
2402
|
/* @__PURE__ */ jsxs("label", { className: "block", children: [
|
|
@@ -2777,12 +2882,13 @@ var BookingSuccess = ({
|
|
|
2777
2882
|
bookingData: initialBookingData,
|
|
2778
2883
|
token,
|
|
2779
2884
|
apiConfig,
|
|
2780
|
-
|
|
2885
|
+
onScheduleAgain,
|
|
2781
2886
|
className
|
|
2782
2887
|
}) => {
|
|
2783
2888
|
const [bookingData, setBookingData] = useState(initialBookingData || null);
|
|
2784
2889
|
const [loading, setLoading] = useState(false);
|
|
2785
2890
|
const [error, setError] = useState(null);
|
|
2891
|
+
const [isCancelled, setIsCancelled] = useState(false);
|
|
2786
2892
|
useEffect(() => {
|
|
2787
2893
|
if (token && apiConfig && !initialBookingData) {
|
|
2788
2894
|
const fetchBookingData = async () => {
|
|
@@ -2790,8 +2896,9 @@ var BookingSuccess = ({
|
|
|
2790
2896
|
setError(null);
|
|
2791
2897
|
try {
|
|
2792
2898
|
const apiClient = createDemoRoomApi(apiConfig);
|
|
2793
|
-
const booking = await apiClient.getBooking(token);
|
|
2899
|
+
const booking = await apiClient.getBooking(token, apiConfig.locale);
|
|
2794
2900
|
setBookingData(booking);
|
|
2901
|
+
setIsCancelled(booking.status === "cancelled");
|
|
2795
2902
|
} catch (err) {
|
|
2796
2903
|
console.error("Failed to fetch booking data:", err);
|
|
2797
2904
|
setError("Failed to load booking information");
|
|
@@ -2803,140 +2910,115 @@ var BookingSuccess = ({
|
|
|
2803
2910
|
}
|
|
2804
2911
|
}, [token, apiConfig, initialBookingData]);
|
|
2805
2912
|
if (loading) {
|
|
2806
|
-
return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-
|
|
2807
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
2808
|
-
/* @__PURE__ */ jsx("
|
|
2809
|
-
|
|
2913
|
+
return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-white py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsx("div", { className: "max-w-3xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "animate-pulse space-y-6", children: [
|
|
2914
|
+
/* @__PURE__ */ jsx("div", { className: "h-8 bg-gray-200 rounded w-1/3" }),
|
|
2915
|
+
/* @__PURE__ */ jsx("div", { className: "h-24 bg-gray-200 rounded" }),
|
|
2916
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
2917
|
+
/* @__PURE__ */ jsx("div", { className: "h-20 bg-gray-200 rounded" }),
|
|
2918
|
+
/* @__PURE__ */ jsx("div", { className: "h-20 bg-gray-200 rounded" }),
|
|
2919
|
+
/* @__PURE__ */ jsx("div", { className: "h-20 bg-gray-200 rounded" })
|
|
2920
|
+
] })
|
|
2921
|
+
] }) }) });
|
|
2810
2922
|
}
|
|
2811
2923
|
if (error || !bookingData) {
|
|
2812
|
-
return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-
|
|
2813
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
2814
|
-
"svg",
|
|
2815
|
-
{
|
|
2816
|
-
width: "32",
|
|
2817
|
-
height: "32",
|
|
2818
|
-
viewBox: "0 0 24 24",
|
|
2819
|
-
fill: "none",
|
|
2820
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2821
|
-
children: /* @__PURE__ */ jsx(
|
|
2822
|
-
"path",
|
|
2823
|
-
{
|
|
2824
|
-
d: "M12 8V12M12 16H12.01M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",
|
|
2825
|
-
stroke: "#EF4444",
|
|
2826
|
-
strokeWidth: "2",
|
|
2827
|
-
strokeLinecap: "round",
|
|
2828
|
-
strokeLinejoin: "round"
|
|
2829
|
-
}
|
|
2830
|
-
)
|
|
2831
|
-
}
|
|
2832
|
-
) }),
|
|
2924
|
+
return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-white py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsx("div", { className: "max-w-3xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "text-center py-12", children: [
|
|
2925
|
+
/* @__PURE__ */ jsx("div", { className: "text-6xl mb-4", children: "\u274C" }),
|
|
2833
2926
|
/* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: error || "Booking Not Found" }),
|
|
2834
|
-
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-600 mb-6", children: "We couldn't find your booking information.
|
|
2835
|
-
|
|
2927
|
+
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-600 mb-6", children: "We couldn't find your booking information." }),
|
|
2928
|
+
onScheduleAgain && /* @__PURE__ */ jsx(
|
|
2836
2929
|
"button",
|
|
2837
2930
|
{
|
|
2838
|
-
onClick:
|
|
2839
|
-
className: "px-6 py-3
|
|
2840
|
-
children: "
|
|
2931
|
+
onClick: onScheduleAgain,
|
|
2932
|
+
className: "px-6 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors",
|
|
2933
|
+
children: "Schedule Again"
|
|
2841
2934
|
}
|
|
2842
2935
|
)
|
|
2843
2936
|
] }) }) });
|
|
2844
2937
|
}
|
|
2845
|
-
return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-
|
|
2846
|
-
/* @__PURE__ */
|
|
2847
|
-
|
|
2848
|
-
|
|
2938
|
+
return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-white py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto", children: [
|
|
2939
|
+
/* @__PURE__ */ jsx("h1", { className: "text-[40px] font-bold text-gray-900 mb-8", children: "Your Appointment" }),
|
|
2940
|
+
isCancelled ? /* @__PURE__ */ jsxs("div", { className: "bg-gray-50 rounded-lg p-6 mb-8 flex items-center justify-between", children: [
|
|
2941
|
+
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-700", children: "This appointment has been canceled." }),
|
|
2942
|
+
onScheduleAgain && /* @__PURE__ */ jsx(
|
|
2943
|
+
"button",
|
|
2849
2944
|
{
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
fill: "none",
|
|
2854
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2855
|
-
children: /* @__PURE__ */ jsx(
|
|
2856
|
-
"path",
|
|
2857
|
-
{
|
|
2858
|
-
d: "M26.6667 8L12 22.6667L5.33334 16",
|
|
2859
|
-
stroke: "white",
|
|
2860
|
-
strokeWidth: "3",
|
|
2861
|
-
strokeLinecap: "round",
|
|
2862
|
-
strokeLinejoin: "round"
|
|
2863
|
-
}
|
|
2864
|
-
)
|
|
2945
|
+
onClick: onScheduleAgain,
|
|
2946
|
+
className: "px-6 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors whitespace-nowrap",
|
|
2947
|
+
children: "Schedule again"
|
|
2865
2948
|
}
|
|
2866
|
-
)
|
|
2867
|
-
|
|
2868
|
-
/* @__PURE__ */ jsx("
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
/* @__PURE__ */ jsxs("div", {
|
|
2873
|
-
/* @__PURE__ */
|
|
2874
|
-
|
|
2875
|
-
/* @__PURE__ */ jsx("
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
/* @__PURE__ */ jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.booking_date })
|
|
2880
|
-
] }),
|
|
2881
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start py-3 border-b border-gray-100", children: [
|
|
2882
|
-
/* @__PURE__ */ jsx("span", { className: "text-base text-gray-600 font-medium", children: "Time" }),
|
|
2883
|
-
/* @__PURE__ */ jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.booking_time })
|
|
2884
|
-
] }),
|
|
2885
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start py-3 border-b border-gray-100", children: [
|
|
2886
|
-
/* @__PURE__ */ jsx("span", { className: "text-base text-gray-600 font-medium", children: "Status" }),
|
|
2887
|
-
/* @__PURE__ */ jsx("span", { className: "inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-[#3ADB67] bg-opacity-10 text-[#3ADB67]", children: bookingData.status })
|
|
2888
|
-
] }),
|
|
2889
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start py-3", children: [
|
|
2890
|
-
/* @__PURE__ */ jsx("span", { className: "text-base text-gray-600 font-medium", children: "Email" }),
|
|
2891
|
-
/* @__PURE__ */ jsx("span", { className: "text-base text-gray-900 font-semibold", children: bookingData.customer_email })
|
|
2892
|
-
] })
|
|
2893
|
-
] })
|
|
2894
|
-
] }),
|
|
2895
|
-
/* @__PURE__ */ jsx("div", { className: "bg-blue-50 border border-blue-200 rounded-[12px] p-6 mb-8", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2896
|
-
/* @__PURE__ */ jsx(
|
|
2897
|
-
"svg",
|
|
2898
|
-
{
|
|
2899
|
-
className: "w-6 h-6 text-blue-600 flex-shrink-0 mt-0.5",
|
|
2900
|
-
fill: "none",
|
|
2901
|
-
viewBox: "0 0 24 24",
|
|
2902
|
-
stroke: "currentColor",
|
|
2903
|
-
children: /* @__PURE__ */ jsx(
|
|
2904
|
-
"path",
|
|
2949
|
+
)
|
|
2950
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "bg-green-50 rounded-lg p-6 mb-8 flex items-center justify-between border border-green-200", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2951
|
+
/* @__PURE__ */ jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }),
|
|
2952
|
+
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-700", children: "Your appointment has been confirmed." })
|
|
2953
|
+
] }) }),
|
|
2954
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-8", children: [
|
|
2955
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2956
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Location" }),
|
|
2957
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
2958
|
+
bookingData.demoroom_name && /* @__PURE__ */ jsx("p", { className: "text-base font-medium text-gray-900", children: bookingData.demoroom_name }),
|
|
2959
|
+
bookingData.address && /* @__PURE__ */ jsx("p", { className: "text-base text-gray-600", children: bookingData.address }),
|
|
2960
|
+
bookingData.latitude && bookingData.longitude && /* @__PURE__ */ jsx(
|
|
2961
|
+
"a",
|
|
2905
2962
|
{
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2963
|
+
href: `https://www.google.com/maps/search/?api=1&query=${bookingData.latitude},${bookingData.longitude}`,
|
|
2964
|
+
target: "_blank",
|
|
2965
|
+
rel: "noopener noreferrer",
|
|
2966
|
+
className: "inline-flex items-center gap-1 text-base text-blue-600 hover:text-blue-700 hover:underline",
|
|
2967
|
+
children: "Open in Google Maps \u2197"
|
|
2910
2968
|
}
|
|
2911
2969
|
)
|
|
2912
|
-
}
|
|
2913
|
-
),
|
|
2970
|
+
] })
|
|
2971
|
+
] }),
|
|
2914
2972
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2915
|
-
/* @__PURE__ */ jsx("
|
|
2916
|
-
/* @__PURE__ */ jsxs("p", { className: "text-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2973
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Date and Time" }),
|
|
2974
|
+
/* @__PURE__ */ jsxs("p", { className: "text-base text-gray-900", children: [
|
|
2975
|
+
bookingData.booking_date,
|
|
2976
|
+
bookingData.time_slot && `, ${bookingData.time_slot}`,
|
|
2977
|
+
!bookingData.time_slot && bookingData.booking_time && `, ${bookingData.booking_time}`
|
|
2978
|
+
] })
|
|
2979
|
+
] }),
|
|
2980
|
+
bookingData.equipment && /* @__PURE__ */ jsxs("div", { children: [
|
|
2981
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Event" }),
|
|
2982
|
+
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: bookingData.equipment })
|
|
2983
|
+
] }),
|
|
2984
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2985
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Demo Room" }),
|
|
2986
|
+
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: bookingData.demoroom_code })
|
|
2987
|
+
] }),
|
|
2988
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2989
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Visitor Info" }),
|
|
2990
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
2991
|
+
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: bookingData.customer_name }),
|
|
2992
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
|
|
2993
|
+
/* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx(
|
|
2994
|
+
"path",
|
|
2995
|
+
{
|
|
2996
|
+
strokeLinecap: "round",
|
|
2997
|
+
strokeLinejoin: "round",
|
|
2998
|
+
strokeWidth: 2,
|
|
2999
|
+
d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
|
|
3000
|
+
}
|
|
3001
|
+
) }),
|
|
3002
|
+
bookingData.phone_code && bookingData.phone_number ? /* @__PURE__ */ jsxs("span", { children: [
|
|
3003
|
+
bookingData.phone_code,
|
|
3004
|
+
" ",
|
|
3005
|
+
bookingData.phone_number
|
|
3006
|
+
] }) : /* @__PURE__ */ jsx("span", { children: "No phone provided" })
|
|
3007
|
+
] }),
|
|
3008
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
|
|
3009
|
+
/* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx(
|
|
3010
|
+
"path",
|
|
3011
|
+
{
|
|
3012
|
+
strokeLinecap: "round",
|
|
3013
|
+
strokeLinejoin: "round",
|
|
3014
|
+
strokeWidth: 2,
|
|
3015
|
+
d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
|
|
3016
|
+
}
|
|
3017
|
+
) }),
|
|
3018
|
+
/* @__PURE__ */ jsx("span", { children: bookingData.customer_email })
|
|
3019
|
+
] })
|
|
2920
3020
|
] })
|
|
2921
3021
|
] })
|
|
2922
|
-
] }) }),
|
|
2923
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-4", children: [
|
|
2924
|
-
onBackToHome && /* @__PURE__ */ jsx(
|
|
2925
|
-
"button",
|
|
2926
|
-
{
|
|
2927
|
-
onClick: onBackToHome,
|
|
2928
|
-
className: "flex-1 px-6 py-4 rounded-full bg-[#3ADB67] text-white font-medium text-base hover:bg-[#2FC257] transition-colors focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
|
|
2929
|
-
children: "Back to Home"
|
|
2930
|
-
}
|
|
2931
|
-
),
|
|
2932
|
-
/* @__PURE__ */ jsx(
|
|
2933
|
-
"button",
|
|
2934
|
-
{
|
|
2935
|
-
onClick: () => window.print(),
|
|
2936
|
-
className: "flex-1 px-6 py-4 rounded-full border-2 border-[#3ADB67] text-[#3ADB67] font-medium text-base hover:bg-[#3ADB67] hover:bg-opacity-5 transition-colors focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
|
|
2937
|
-
children: "Print Confirmation"
|
|
2938
|
-
}
|
|
2939
|
-
)
|
|
2940
3022
|
] })
|
|
2941
3023
|
] }) });
|
|
2942
3024
|
};
|
|
@@ -3079,6 +3161,6 @@ var ThemeProvider = ({
|
|
|
3079
3161
|
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: { theme: theme2 }, children });
|
|
3080
3162
|
};
|
|
3081
3163
|
|
|
3082
|
-
export { BookingForm, BookingSuccess, DemoRoom, DemoRoomApiClient, DemoRoomDetail, ThemeProvider, cn, createDemoRoomApi, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTheme, useTimeslots };
|
|
3164
|
+
export { BookingForm, BookingSuccess, DemoRoom, DemoRoomApiClient, DemoRoomDetail, ThemeProvider, cn, createDemoRoomApi, useBooking, useCancelBooking, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTheme, useTimeslots };
|
|
3083
3165
|
//# sourceMappingURL=index.mjs.map
|
|
3084
3166
|
//# sourceMappingURL=index.mjs.map
|