@anker-in/ui 0.1.5 → 0.1.8
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/README.md +162 -37
- package/dist/DemoRoom-Dx3PluHP.d.mts +85 -0
- package/dist/DemoRoom-Dx3PluHP.d.ts +85 -0
- package/dist/demo-room.d.mts +18 -1
- package/dist/demo-room.d.ts +18 -1
- package/dist/demo-room.js +120 -113
- package/dist/demo-room.js.map +1 -1
- package/dist/demo-room.mjs +120 -113
- package/dist/demo-room.mjs.map +1 -1
- package/dist/index.d.mts +116 -2
- package/dist/index.d.ts +116 -2
- package/dist/index.js +227 -175
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +227 -175
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +0 -1
- package/package.json +1 -1
- package/dist/DemoRoom-CZyrsxWe.d.mts +0 -30
- package/dist/DemoRoom-CZyrsxWe.d.ts +0 -30
package/dist/demo-room.js
CHANGED
|
@@ -22,7 +22,7 @@ var Title = ({
|
|
|
22
22
|
title = "",
|
|
23
23
|
...props
|
|
24
24
|
}) => {
|
|
25
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[48px] font-
|
|
25
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-[32px] min-l:text-[48px] font-bold mb-12 text-[#080A0F]", children: title }) });
|
|
26
26
|
};
|
|
27
27
|
Title.displayName = "Title";
|
|
28
28
|
var StudioCard = ({
|
|
@@ -30,18 +30,18 @@ var StudioCard = ({
|
|
|
30
30
|
name,
|
|
31
31
|
availableTime,
|
|
32
32
|
address,
|
|
33
|
-
city,
|
|
34
|
-
state,
|
|
35
|
-
zipCode,
|
|
36
|
-
country = "United States",
|
|
37
33
|
euifyMakeModel,
|
|
38
34
|
distance,
|
|
39
35
|
onSchedule,
|
|
36
|
+
pageData = {
|
|
37
|
+
scheduleNow: "Schedule Now",
|
|
38
|
+
available: "Available",
|
|
39
|
+
away: "away"
|
|
40
|
+
},
|
|
40
41
|
className,
|
|
41
42
|
style,
|
|
42
43
|
...props
|
|
43
44
|
}) => {
|
|
44
|
-
const fullAddress = `${address}, ${city}, ${state} ${country} ${zipCode}`;
|
|
45
45
|
const [isHovered, setIsHovered] = React2__default.default.useState(false);
|
|
46
46
|
const handleScheduleClick = () => {
|
|
47
47
|
onSchedule?.(code);
|
|
@@ -74,7 +74,8 @@ var StudioCard = ({
|
|
|
74
74
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-semibold text-gray-900", children: name }),
|
|
75
75
|
distance !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-medium text-[#2E8B57] bg-[#E8F5E9] px-3 py-1 rounded-full whitespace-nowrap ml-2", children: [
|
|
76
76
|
formatDistance(distance),
|
|
77
|
-
"
|
|
77
|
+
" ",
|
|
78
|
+
pageData.away
|
|
78
79
|
] })
|
|
79
80
|
] }),
|
|
80
81
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
|
|
@@ -131,7 +132,8 @@ var StudioCard = ({
|
|
|
131
132
|
}
|
|
132
133
|
),
|
|
133
134
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-600", children: [
|
|
134
|
-
|
|
135
|
+
pageData.available,
|
|
136
|
+
" ",
|
|
135
137
|
availableTime
|
|
136
138
|
] }) })
|
|
137
139
|
] }),
|
|
@@ -165,7 +167,7 @@ var StudioCard = ({
|
|
|
165
167
|
]
|
|
166
168
|
}
|
|
167
169
|
),
|
|
168
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600", children:
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600 break-words", children: address }) })
|
|
169
171
|
] }),
|
|
170
172
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 mb-6", children: [
|
|
171
173
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -222,10 +224,10 @@ var StudioCard = ({
|
|
|
222
224
|
"w-full px-6 py-3 rounded-full",
|
|
223
225
|
"bg-white text-gray-900 border border-gray-900",
|
|
224
226
|
"font-medium text-sm",
|
|
225
|
-
"hover:bg-gray-900",
|
|
227
|
+
"hover:bg-gray-900 hover:text-white",
|
|
226
228
|
"transition-all duration-200"
|
|
227
229
|
),
|
|
228
|
-
children:
|
|
230
|
+
children: pageData.scheduleNow
|
|
229
231
|
}
|
|
230
232
|
)
|
|
231
233
|
]
|
|
@@ -257,6 +259,12 @@ var StudioMap = ({
|
|
|
257
259
|
defaultZoom = 4,
|
|
258
260
|
mapHeight = "600px",
|
|
259
261
|
onSchedule,
|
|
262
|
+
pageData = {
|
|
263
|
+
apiKeyRequired: "Google Maps API Key is required",
|
|
264
|
+
loadingMap: "Loading map...",
|
|
265
|
+
scheduleNow: "Schedule Now",
|
|
266
|
+
available: "Available"
|
|
267
|
+
},
|
|
260
268
|
className,
|
|
261
269
|
...props
|
|
262
270
|
}) => {
|
|
@@ -355,13 +363,13 @@ var StudioMap = ({
|
|
|
355
363
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
356
364
|
<path d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"/>
|
|
357
365
|
</svg>
|
|
358
|
-
<span style="vertical-align: middle;"
|
|
366
|
+
<span style="vertical-align: middle;">${pageData.available} ${location.availableTime}</span>
|
|
359
367
|
</div>` : ""}
|
|
360
368
|
<div style="margin-bottom: 8px; color: #666;">
|
|
361
369
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
362
370
|
<path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z" clip-rule="evenodd"/>
|
|
363
371
|
</svg>
|
|
364
|
-
<span style="vertical-align: middle;">${location.address}
|
|
372
|
+
<span style="vertical-align: middle;">${location.address}</span>
|
|
365
373
|
</div>
|
|
366
374
|
${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
|
|
367
375
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
@@ -385,7 +393,7 @@ var StudioMap = ({
|
|
|
385
393
|
onmouseover="this.style.background='#333'"
|
|
386
394
|
onmouseout="this.style.background='#000'"
|
|
387
395
|
>
|
|
388
|
-
|
|
396
|
+
${pageData.scheduleNow}
|
|
389
397
|
</button>
|
|
390
398
|
</div>
|
|
391
399
|
`;
|
|
@@ -441,13 +449,13 @@ var StudioMap = ({
|
|
|
441
449
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
442
450
|
<path d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"/>
|
|
443
451
|
</svg>
|
|
444
|
-
<span style="vertical-align: middle;"
|
|
452
|
+
<span style="vertical-align: middle;">${pageData.available} ${location.availableTime}</span>
|
|
445
453
|
</div>` : ""}
|
|
446
454
|
<div style="margin-bottom: 8px; color: #666;">
|
|
447
455
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
448
456
|
<path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z" clip-rule="evenodd"/>
|
|
449
457
|
</svg>
|
|
450
|
-
<span style="vertical-align: middle;">${location.address}
|
|
458
|
+
<span style="vertical-align: middle;">${location.address}</span>
|
|
451
459
|
</div>
|
|
452
460
|
${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
|
|
453
461
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
@@ -471,7 +479,7 @@ var StudioMap = ({
|
|
|
471
479
|
onmouseover="this.style.background='#333'"
|
|
472
480
|
onmouseout="this.style.background='#000'"
|
|
473
481
|
>
|
|
474
|
-
|
|
482
|
+
${pageData.scheduleNow}
|
|
475
483
|
</button>
|
|
476
484
|
</div>
|
|
477
485
|
`;
|
|
@@ -507,7 +515,7 @@ var StudioMap = ({
|
|
|
507
515
|
),
|
|
508
516
|
style: { height: mapHeight },
|
|
509
517
|
...props,
|
|
510
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children:
|
|
518
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: pageData.apiKeyRequired })
|
|
511
519
|
}
|
|
512
520
|
);
|
|
513
521
|
}
|
|
@@ -520,7 +528,7 @@ var StudioMap = ({
|
|
|
520
528
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: mapRef, style: { height: mapHeight } }),
|
|
521
529
|
!isLoaded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-100", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
522
530
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-gray-900 mb-2" }),
|
|
523
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children:
|
|
531
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: pageData.loadingMap })
|
|
524
532
|
] }) })
|
|
525
533
|
]
|
|
526
534
|
}
|
|
@@ -616,65 +624,6 @@ var AntdMobileIsolated = ({
|
|
|
616
624
|
AntdMobileIsolated.displayName = "AntdMobileIsolated";
|
|
617
625
|
|
|
618
626
|
// src/components/DemoRoom/utils/addressParser.ts
|
|
619
|
-
var KNOWN_COUNTRIES = [
|
|
620
|
-
"United States",
|
|
621
|
-
"United Kingdom",
|
|
622
|
-
"American Samoa",
|
|
623
|
-
"United Arab Emirates",
|
|
624
|
-
"Bosnia and Herzegovina",
|
|
625
|
-
"Trinidad and Tobago",
|
|
626
|
-
"Saint Kitts and Nevis",
|
|
627
|
-
"Antigua and Barbuda",
|
|
628
|
-
"Saint Vincent and the Grenadines",
|
|
629
|
-
"S\xE3o Tom\xE9 and Pr\xEDncipe",
|
|
630
|
-
"United States Minor Outlying Islands",
|
|
631
|
-
"British Virgin Islands",
|
|
632
|
-
"United States Virgin Islands",
|
|
633
|
-
"Cayman Islands",
|
|
634
|
-
"Cook Islands",
|
|
635
|
-
"Falkland Islands",
|
|
636
|
-
"Faroe Islands",
|
|
637
|
-
"Marshall Islands",
|
|
638
|
-
"Northern Mariana Islands",
|
|
639
|
-
"Pitcairn Islands",
|
|
640
|
-
"Solomon Islands",
|
|
641
|
-
"Turks and Caicos Islands",
|
|
642
|
-
"Wallis and Futuna"
|
|
643
|
-
];
|
|
644
|
-
function parseAddress(address) {
|
|
645
|
-
const parts = address.split(",").map((part) => part.trim()).filter(Boolean);
|
|
646
|
-
let country = "United States";
|
|
647
|
-
let state = "";
|
|
648
|
-
let city = "";
|
|
649
|
-
if (parts.length === 0) {
|
|
650
|
-
return { country, state, city };
|
|
651
|
-
}
|
|
652
|
-
const lastPart = parts[parts.length - 1];
|
|
653
|
-
const matchedCountry = KNOWN_COUNTRIES.find(
|
|
654
|
-
(knownCountry) => lastPart.toLowerCase() === knownCountry.toLowerCase()
|
|
655
|
-
);
|
|
656
|
-
if (matchedCountry) {
|
|
657
|
-
country = matchedCountry;
|
|
658
|
-
if (parts.length >= 2) {
|
|
659
|
-
state = parts[parts.length - 2].split(" ")[0];
|
|
660
|
-
}
|
|
661
|
-
if (parts.length >= 3) {
|
|
662
|
-
city = parts[parts.length - 3];
|
|
663
|
-
}
|
|
664
|
-
} else {
|
|
665
|
-
if (parts.length >= 2) {
|
|
666
|
-
state = parts[parts.length - 1].split(" ")[0];
|
|
667
|
-
city = parts[parts.length - 2];
|
|
668
|
-
} else if (parts.length === 1) {
|
|
669
|
-
city = parts[0];
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
return {
|
|
673
|
-
country: country.trim(),
|
|
674
|
-
state: state.trim(),
|
|
675
|
-
city: city.trim()
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
627
|
function groupByAlphabet(items) {
|
|
679
628
|
const groups = /* @__PURE__ */ new Map();
|
|
680
629
|
items.forEach((item) => {
|
|
@@ -701,7 +650,15 @@ var LocationFilter = ({
|
|
|
701
650
|
locations,
|
|
702
651
|
onSelect,
|
|
703
652
|
visible = false,
|
|
704
|
-
onClose
|
|
653
|
+
onClose,
|
|
654
|
+
pageData = {
|
|
655
|
+
allLocations: "All Locations",
|
|
656
|
+
clear: "Clear",
|
|
657
|
+
country: "Country",
|
|
658
|
+
state: "State",
|
|
659
|
+
city: "City",
|
|
660
|
+
noStudiosFound: "No studios found in this location"
|
|
661
|
+
}
|
|
705
662
|
}) => {
|
|
706
663
|
const [currentLevel, setCurrentLevel] = React2.useState("country");
|
|
707
664
|
const [selectedCountry, setSelectedCountry] = React2.useState();
|
|
@@ -712,7 +669,7 @@ var LocationFilter = ({
|
|
|
712
669
|
const states = /* @__PURE__ */ new Map();
|
|
713
670
|
const cities = /* @__PURE__ */ new Map();
|
|
714
671
|
locations.forEach((location) => {
|
|
715
|
-
const { country, state, city } =
|
|
672
|
+
const { country, state, city } = location;
|
|
716
673
|
if (country) {
|
|
717
674
|
const existing = countries.get(country);
|
|
718
675
|
countries.set(country, {
|
|
@@ -849,7 +806,7 @@ var LocationFilter = ({
|
|
|
849
806
|
"pb-[4px] transition-colors",
|
|
850
807
|
currentLevel === "country" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]"
|
|
851
808
|
),
|
|
852
|
-
children:
|
|
809
|
+
children: pageData.country
|
|
853
810
|
}
|
|
854
811
|
),
|
|
855
812
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -862,7 +819,7 @@ var LocationFilter = ({
|
|
|
862
819
|
currentLevel === "state" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]",
|
|
863
820
|
!selectedCountry && "opacity-50 cursor-not-allowed"
|
|
864
821
|
),
|
|
865
|
-
children:
|
|
822
|
+
children: pageData.state
|
|
866
823
|
}
|
|
867
824
|
),
|
|
868
825
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -875,7 +832,7 @@ var LocationFilter = ({
|
|
|
875
832
|
currentLevel === "city" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]",
|
|
876
833
|
!selectedState && "opacity-50 cursor-not-allowed"
|
|
877
834
|
),
|
|
878
|
-
children:
|
|
835
|
+
children: pageData.city
|
|
879
836
|
}
|
|
880
837
|
)
|
|
881
838
|
] })
|
|
@@ -907,11 +864,37 @@ var LocationFilter = ({
|
|
|
907
864
|
);
|
|
908
865
|
};
|
|
909
866
|
LocationFilter.displayName = "LocationFilter";
|
|
867
|
+
var defaultPageData = {
|
|
868
|
+
title: "Find a Studio Near You",
|
|
869
|
+
loadingText: "Loading demo rooms...",
|
|
870
|
+
errorTitle: "Failed to load demo rooms",
|
|
871
|
+
locationFilter: {
|
|
872
|
+
allLocations: "All Locations",
|
|
873
|
+
clear: "Clear",
|
|
874
|
+
country: "Country",
|
|
875
|
+
state: "State",
|
|
876
|
+
city: "City",
|
|
877
|
+
noStudiosFound: "No studios found in this location"
|
|
878
|
+
},
|
|
879
|
+
studioCard: {
|
|
880
|
+
scheduleNow: "Schedule Now",
|
|
881
|
+
available: "Available",
|
|
882
|
+
away: "away"
|
|
883
|
+
},
|
|
884
|
+
map: {
|
|
885
|
+
apiKeyRequired: "Google Maps API Key is required",
|
|
886
|
+
loadingMap: "Loading map...",
|
|
887
|
+
scheduleNow: "Schedule Now",
|
|
888
|
+
available: "Available"
|
|
889
|
+
},
|
|
890
|
+
defaultCountry: "United States",
|
|
891
|
+
noAvailableTime: "No available time"
|
|
892
|
+
};
|
|
910
893
|
var defaultStudioLocations = [
|
|
911
894
|
{
|
|
912
895
|
id: "1",
|
|
913
896
|
name: "Design District Demo Room",
|
|
914
|
-
address: "111 8th St",
|
|
897
|
+
address: "111 8th St, San Francisco, CA, United States",
|
|
915
898
|
city: "San Francisco",
|
|
916
899
|
state: "CA",
|
|
917
900
|
zipCode: "94108",
|
|
@@ -924,7 +907,7 @@ var defaultStudioLocations = [
|
|
|
924
907
|
{
|
|
925
908
|
id: "2",
|
|
926
909
|
name: "Brooklyn Creative Studio",
|
|
927
|
-
address: "456 Broadway",
|
|
910
|
+
address: "456 Broadway, Brooklyn, NY, United States",
|
|
928
911
|
city: "Brooklyn",
|
|
929
912
|
state: "NY",
|
|
930
913
|
zipCode: "11211",
|
|
@@ -937,7 +920,7 @@ var defaultStudioLocations = [
|
|
|
937
920
|
{
|
|
938
921
|
id: "3",
|
|
939
922
|
name: "Austin Innovation Hub",
|
|
940
|
-
address: "789 Tech Blvd",
|
|
923
|
+
address: "789 Tech Blvd, Austin, TX, United States",
|
|
941
924
|
city: "Austin",
|
|
942
925
|
state: "TX",
|
|
943
926
|
zipCode: "78701",
|
|
@@ -950,7 +933,7 @@ var defaultStudioLocations = [
|
|
|
950
933
|
{
|
|
951
934
|
id: "4",
|
|
952
935
|
name: "Seattle Maker Space",
|
|
953
|
-
address: "321 Pine St",
|
|
936
|
+
address: "321 Pine St, Seattle, WA, United States",
|
|
954
937
|
city: "Seattle",
|
|
955
938
|
state: "WA",
|
|
956
939
|
zipCode: "98101",
|
|
@@ -963,7 +946,7 @@ var defaultStudioLocations = [
|
|
|
963
946
|
{
|
|
964
947
|
id: "5",
|
|
965
948
|
name: "Chicago Design Center",
|
|
966
|
-
address: "654 Michigan Ave",
|
|
949
|
+
address: "654 Michigan Ave, Chicago, IL, United States",
|
|
967
950
|
city: "Chicago",
|
|
968
951
|
state: "IL",
|
|
969
952
|
zipCode: "60611",
|
|
@@ -976,7 +959,7 @@ var defaultStudioLocations = [
|
|
|
976
959
|
{
|
|
977
960
|
id: "6",
|
|
978
961
|
name: "Miami Beach Studio",
|
|
979
|
-
address: "987 Ocean Drive",
|
|
962
|
+
address: "987 Ocean Drive, Miami Beach, FL, United States",
|
|
980
963
|
city: "Miami Beach",
|
|
981
964
|
state: "FL",
|
|
982
965
|
zipCode: "33139",
|
|
@@ -989,7 +972,7 @@ var defaultStudioLocations = [
|
|
|
989
972
|
{
|
|
990
973
|
id: "7",
|
|
991
974
|
name: "Denver Mountain Studio",
|
|
992
|
-
address: "147 16th St",
|
|
975
|
+
address: "147 16th St, Denver, CO, United States",
|
|
993
976
|
city: "Denver",
|
|
994
977
|
state: "CO",
|
|
995
978
|
zipCode: "80202",
|
|
@@ -1002,7 +985,7 @@ var defaultStudioLocations = [
|
|
|
1002
985
|
{
|
|
1003
986
|
id: "8",
|
|
1004
987
|
name: "Los Angeles Creative Lab",
|
|
1005
|
-
address: "258 Main St",
|
|
988
|
+
address: "258 Main St, Los Angeles, CA, United States",
|
|
1006
989
|
city: "Los Angeles",
|
|
1007
990
|
state: "CA",
|
|
1008
991
|
zipCode: "90012",
|
|
@@ -1020,8 +1003,22 @@ var RoomsList = ({
|
|
|
1020
1003
|
teamCode,
|
|
1021
1004
|
brandWebsite,
|
|
1022
1005
|
onSchedule,
|
|
1006
|
+
pageData,
|
|
1023
1007
|
...props
|
|
1024
1008
|
}) => {
|
|
1009
|
+
const mergedPageData = React2.useMemo(
|
|
1010
|
+
() => ({
|
|
1011
|
+
...defaultPageData,
|
|
1012
|
+
...pageData,
|
|
1013
|
+
locationFilter: {
|
|
1014
|
+
...defaultPageData.locationFilter,
|
|
1015
|
+
...pageData?.locationFilter
|
|
1016
|
+
},
|
|
1017
|
+
studioCard: { ...defaultPageData.studioCard, ...pageData?.studioCard },
|
|
1018
|
+
map: { ...defaultPageData.map, ...pageData?.map }
|
|
1019
|
+
}),
|
|
1020
|
+
[pageData]
|
|
1021
|
+
);
|
|
1025
1022
|
const [showLocationFilter, setShowLocationFilter] = React2.useState(false);
|
|
1026
1023
|
const [selectedLocation, setSelectedLocation] = React2.useState();
|
|
1027
1024
|
const [hoveredRoomId, setHoveredRoomId] = React2.useState(null);
|
|
@@ -1040,18 +1037,22 @@ var RoomsList = ({
|
|
|
1040
1037
|
const nextAvailableTimeslot = room?.timeslots?.find(
|
|
1041
1038
|
(slot) => slot.status === "available"
|
|
1042
1039
|
);
|
|
1043
|
-
const
|
|
1040
|
+
const country = room.location?.country || mergedPageData.defaultCountry;
|
|
1041
|
+
const state = room.location?.state || "";
|
|
1042
|
+
const city = room.location?.city || "";
|
|
1043
|
+
const addressParts = [room.address, city, state, country].filter(Boolean);
|
|
1044
|
+
const fullAddress = addressParts.join(", ");
|
|
1044
1045
|
return {
|
|
1045
1046
|
id: room.code,
|
|
1046
1047
|
name: room.name,
|
|
1047
|
-
address:
|
|
1048
|
+
address: fullAddress,
|
|
1048
1049
|
city,
|
|
1049
1050
|
state,
|
|
1050
1051
|
zipCode: "",
|
|
1051
1052
|
country,
|
|
1052
1053
|
lat: Number(room.latitude) || 34.0522,
|
|
1053
1054
|
lng: Number(room.longitude) || -118.2437,
|
|
1054
|
-
availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` :
|
|
1055
|
+
availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` : mergedPageData.noAvailableTime,
|
|
1055
1056
|
euifyMakeModel: room?.description
|
|
1056
1057
|
};
|
|
1057
1058
|
});
|
|
@@ -1059,25 +1060,24 @@ var RoomsList = ({
|
|
|
1059
1060
|
const filteredStudioLocations = React2.useMemo(() => {
|
|
1060
1061
|
if (!selectedLocation) return studioLocations;
|
|
1061
1062
|
return studioLocations.filter((location) => {
|
|
1062
|
-
const { country, state, city } = parseAddress(location.address);
|
|
1063
1063
|
if (selectedLocation.city) {
|
|
1064
|
-
return country === selectedLocation.country && state === selectedLocation.state && city === selectedLocation.city;
|
|
1064
|
+
return location.country === selectedLocation.country && location.state === selectedLocation.state && location.city === selectedLocation.city;
|
|
1065
1065
|
}
|
|
1066
1066
|
if (selectedLocation.state) {
|
|
1067
|
-
return country === selectedLocation.country && state === selectedLocation.state;
|
|
1067
|
+
return location.country === selectedLocation.country && location.state === selectedLocation.state;
|
|
1068
1068
|
}
|
|
1069
1069
|
if (selectedLocation.country) {
|
|
1070
|
-
return country === selectedLocation.country;
|
|
1070
|
+
return location.country === selectedLocation.country;
|
|
1071
1071
|
}
|
|
1072
1072
|
return true;
|
|
1073
1073
|
});
|
|
1074
1074
|
}, [studioLocations, selectedLocation]);
|
|
1075
1075
|
const getSelectedLocationName = () => {
|
|
1076
|
-
if (!selectedLocation) return
|
|
1076
|
+
if (!selectedLocation) return mergedPageData.locationFilter.allLocations;
|
|
1077
1077
|
if (selectedLocation.city) return selectedLocation.city;
|
|
1078
1078
|
if (selectedLocation.state) return selectedLocation.state;
|
|
1079
1079
|
if (selectedLocation.country) return selectedLocation.country;
|
|
1080
|
-
return
|
|
1080
|
+
return mergedPageData.locationFilter.allLocations;
|
|
1081
1081
|
};
|
|
1082
1082
|
const handleLocationSelect = (selection) => {
|
|
1083
1083
|
setSelectedLocation(selection);
|
|
@@ -1088,17 +1088,17 @@ var RoomsList = ({
|
|
|
1088
1088
|
};
|
|
1089
1089
|
console.log(filteredStudioLocations);
|
|
1090
1090
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, ...props, children: [
|
|
1091
|
-
/* @__PURE__ */ jsxRuntime.jsx(Title, { title:
|
|
1092
|
-
loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children:
|
|
1091
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title, { title: mergedPageData.title }),
|
|
1092
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children: mergedPageData.loadingText }) }) }),
|
|
1093
1093
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", style: { color: "#FF4D4D" }, children: [
|
|
1094
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children:
|
|
1094
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children: mergedPageData.errorTitle }),
|
|
1095
1095
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm mt-2", children: error.message })
|
|
1096
1096
|
] }) }),
|
|
1097
1097
|
!loading && !error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-[794px] gap-4", children: [
|
|
1098
1098
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1099
1099
|
"div",
|
|
1100
1100
|
{
|
|
1101
|
-
className: "flex-none relative w-[420px]",
|
|
1101
|
+
className: "flex-none relative w-[420px] l:!w-full",
|
|
1102
1102
|
style: { height: "794px" },
|
|
1103
1103
|
children: [
|
|
1104
1104
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-[12px] mb-4 bg-white border border-[#E4E5E6] px-[20px] py-[16px]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-[40px] font-bold text-[16px] gap-10 flex items-center", children: [
|
|
@@ -1134,7 +1134,7 @@ var RoomsList = ({
|
|
|
1134
1134
|
{
|
|
1135
1135
|
onClick: handleClearFilter,
|
|
1136
1136
|
className: "ml-auto text-[14px] text-[#2E8B57] hover:underline",
|
|
1137
|
-
children:
|
|
1137
|
+
children: mergedPageData.locationFilter.clear
|
|
1138
1138
|
}
|
|
1139
1139
|
),
|
|
1140
1140
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex text-[#767880] cursor-not-allowed", children: [
|
|
@@ -1163,7 +1163,7 @@ var RoomsList = ({
|
|
|
1163
1163
|
{
|
|
1164
1164
|
style: { maxHeight: "706px", overflow: "auto" },
|
|
1165
1165
|
className: "rounded-[12px] bg-white border border-[#E4E5E6]",
|
|
1166
|
-
children: filteredStudioLocations.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[200px] text-[#767880]", children:
|
|
1166
|
+
children: filteredStudioLocations.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[200px] text-[#767880]", children: mergedPageData.locationFilter.noStudiosFound }) : filteredStudioLocations.map((item) => {
|
|
1167
1167
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1168
1168
|
StudioCard,
|
|
1169
1169
|
{
|
|
@@ -1177,7 +1177,8 @@ var RoomsList = ({
|
|
|
1177
1177
|
euifyMakeModel: item?.euifyMakeModel || "",
|
|
1178
1178
|
onSchedule,
|
|
1179
1179
|
onMouseEnter: () => setHoveredRoomId(item.id),
|
|
1180
|
-
onMouseLeave: () => setHoveredRoomId(null)
|
|
1180
|
+
onMouseLeave: () => setHoveredRoomId(null),
|
|
1181
|
+
pageData: mergedPageData.studioCard
|
|
1181
1182
|
},
|
|
1182
1183
|
item.id
|
|
1183
1184
|
);
|
|
@@ -1188,25 +1189,29 @@ var RoomsList = ({
|
|
|
1188
1189
|
LocationFilter,
|
|
1189
1190
|
{
|
|
1190
1191
|
locations: studioLocations.map((loc) => ({
|
|
1191
|
-
|
|
1192
|
-
|
|
1192
|
+
id: loc.id,
|
|
1193
|
+
country: loc.country,
|
|
1194
|
+
state: loc.state,
|
|
1195
|
+
city: loc.city
|
|
1193
1196
|
})),
|
|
1194
1197
|
visible: showLocationFilter,
|
|
1195
1198
|
onSelect: handleLocationSelect,
|
|
1196
|
-
onClose: () => setShowLocationFilter(false)
|
|
1199
|
+
onClose: () => setShowLocationFilter(false),
|
|
1200
|
+
pageData: mergedPageData.locationFilter
|
|
1197
1201
|
}
|
|
1198
1202
|
)
|
|
1199
1203
|
]
|
|
1200
1204
|
}
|
|
1201
1205
|
),
|
|
1202
|
-
googleMapsApiKey && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1206
|
+
googleMapsApiKey && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 l:!hidden"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1203
1207
|
StudioMap,
|
|
1204
1208
|
{
|
|
1205
1209
|
googleMapsApiKey,
|
|
1206
1210
|
locations: filteredStudioLocations,
|
|
1207
1211
|
hoveredLocationId: hoveredRoomId,
|
|
1208
1212
|
onSchedule,
|
|
1209
|
-
mapHeight: "794px"
|
|
1213
|
+
mapHeight: "794px",
|
|
1214
|
+
pageData: mergedPageData.map
|
|
1210
1215
|
}
|
|
1211
1216
|
) })
|
|
1212
1217
|
] })
|
|
@@ -1388,6 +1393,7 @@ var DemoRoom = ({
|
|
|
1388
1393
|
teamCode,
|
|
1389
1394
|
brandWebsite,
|
|
1390
1395
|
onSchedule,
|
|
1396
|
+
pageData,
|
|
1391
1397
|
...props
|
|
1392
1398
|
}) => {
|
|
1393
1399
|
const apiClient = React2.useMemo(
|
|
@@ -1402,7 +1408,8 @@ var DemoRoom = ({
|
|
|
1402
1408
|
apiClient,
|
|
1403
1409
|
teamCode,
|
|
1404
1410
|
brandWebsite,
|
|
1405
|
-
onSchedule
|
|
1411
|
+
onSchedule,
|
|
1412
|
+
pageData
|
|
1406
1413
|
}
|
|
1407
1414
|
) });
|
|
1408
1415
|
};
|