@anker-in/ui 0.1.5 → 0.1.9
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-YZ2To7p9.d.mts +86 -0
- package/dist/DemoRoom-YZ2To7p9.d.ts +86 -0
- package/dist/demo-room.d.mts +18 -1
- package/dist/demo-room.d.ts +18 -1
- package/dist/demo-room.js +134 -122
- package/dist/demo-room.js.map +1 -1
- package/dist/demo-room.mjs +134 -122
- package/dist/demo-room.mjs.map +1 -1
- package/dist/index.d.mts +117 -3
- package/dist/index.d.ts +117 -3
- package/dist/index.js +404 -219
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +404 -219
- 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
|
}) => {
|
|
@@ -333,18 +341,22 @@ var StudioMap = ({
|
|
|
333
341
|
validLocations.forEach((location) => {
|
|
334
342
|
const lat = Number(location.lat);
|
|
335
343
|
const lng = Number(location.lng);
|
|
344
|
+
const svgIcon = {
|
|
345
|
+
url: `data:image/svg+xml;charset=UTF-8,${encodeURIComponent(`
|
|
346
|
+
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
347
|
+
<circle cx="24" cy="24" r="22" fill="#00000010"/>
|
|
348
|
+
<circle cx="24" cy="24" r="10" fill="#000000"/>
|
|
349
|
+
<circle cx="24" cy="24" r="5" fill="#3ADB67"/>
|
|
350
|
+
</svg>
|
|
351
|
+
`)}`,
|
|
352
|
+
scaledSize: { width: 48, height: 48 },
|
|
353
|
+
anchor: { x: 24, y: 24 }
|
|
354
|
+
};
|
|
336
355
|
const marker = new google.maps.Marker({
|
|
337
356
|
position: { lat, lng },
|
|
338
357
|
map: googleMapRef.current,
|
|
339
358
|
title: location.name,
|
|
340
|
-
icon:
|
|
341
|
-
path: google.maps.SymbolPath.CIRCLE,
|
|
342
|
-
scale: 10,
|
|
343
|
-
fillColor: "#000000",
|
|
344
|
-
fillOpacity: 1,
|
|
345
|
-
strokeColor: "#ffffff",
|
|
346
|
-
strokeWeight: 2
|
|
347
|
-
}
|
|
359
|
+
icon: svgIcon
|
|
348
360
|
});
|
|
349
361
|
marker.addListener("click", () => {
|
|
350
362
|
setSelectedLocation(location);
|
|
@@ -355,13 +367,13 @@ var StudioMap = ({
|
|
|
355
367
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
356
368
|
<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
369
|
</svg>
|
|
358
|
-
<span style="vertical-align: middle;"
|
|
370
|
+
<span style="vertical-align: middle;">${pageData.available} ${location.availableTime}</span>
|
|
359
371
|
</div>` : ""}
|
|
360
372
|
<div style="margin-bottom: 8px; color: #666;">
|
|
361
373
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
362
374
|
<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
375
|
</svg>
|
|
364
|
-
<span style="vertical-align: middle;">${location.address}
|
|
376
|
+
<span style="vertical-align: middle;">${location.address}</span>
|
|
365
377
|
</div>
|
|
366
378
|
${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
|
|
367
379
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
@@ -385,7 +397,7 @@ var StudioMap = ({
|
|
|
385
397
|
onmouseover="this.style.background='#333'"
|
|
386
398
|
onmouseout="this.style.background='#000'"
|
|
387
399
|
>
|
|
388
|
-
|
|
400
|
+
${pageData.scheduleNow}
|
|
389
401
|
</button>
|
|
390
402
|
</div>
|
|
391
403
|
`;
|
|
@@ -441,13 +453,13 @@ var StudioMap = ({
|
|
|
441
453
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
442
454
|
<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
455
|
</svg>
|
|
444
|
-
<span style="vertical-align: middle;"
|
|
456
|
+
<span style="vertical-align: middle;">${pageData.available} ${location.availableTime}</span>
|
|
445
457
|
</div>` : ""}
|
|
446
458
|
<div style="margin-bottom: 8px; color: #666;">
|
|
447
459
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
448
460
|
<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
461
|
</svg>
|
|
450
|
-
<span style="vertical-align: middle;">${location.address}
|
|
462
|
+
<span style="vertical-align: middle;">${location.address}</span>
|
|
451
463
|
</div>
|
|
452
464
|
${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
|
|
453
465
|
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
@@ -471,7 +483,7 @@ var StudioMap = ({
|
|
|
471
483
|
onmouseover="this.style.background='#333'"
|
|
472
484
|
onmouseout="this.style.background='#000'"
|
|
473
485
|
>
|
|
474
|
-
|
|
486
|
+
${pageData.scheduleNow}
|
|
475
487
|
</button>
|
|
476
488
|
</div>
|
|
477
489
|
`;
|
|
@@ -507,7 +519,7 @@ var StudioMap = ({
|
|
|
507
519
|
),
|
|
508
520
|
style: { height: mapHeight },
|
|
509
521
|
...props,
|
|
510
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children:
|
|
522
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: pageData.apiKeyRequired })
|
|
511
523
|
}
|
|
512
524
|
);
|
|
513
525
|
}
|
|
@@ -520,7 +532,7 @@ var StudioMap = ({
|
|
|
520
532
|
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: mapRef, style: { height: mapHeight } }),
|
|
521
533
|
!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
534
|
/* @__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:
|
|
535
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: pageData.loadingMap })
|
|
524
536
|
] }) })
|
|
525
537
|
]
|
|
526
538
|
}
|
|
@@ -616,65 +628,6 @@ var AntdMobileIsolated = ({
|
|
|
616
628
|
AntdMobileIsolated.displayName = "AntdMobileIsolated";
|
|
617
629
|
|
|
618
630
|
// 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
631
|
function groupByAlphabet(items) {
|
|
679
632
|
const groups = /* @__PURE__ */ new Map();
|
|
680
633
|
items.forEach((item) => {
|
|
@@ -701,7 +654,15 @@ var LocationFilter = ({
|
|
|
701
654
|
locations,
|
|
702
655
|
onSelect,
|
|
703
656
|
visible = false,
|
|
704
|
-
onClose
|
|
657
|
+
onClose,
|
|
658
|
+
pageData = {
|
|
659
|
+
allLocations: "All Locations",
|
|
660
|
+
clear: "Clear",
|
|
661
|
+
country: "Country",
|
|
662
|
+
state: "State",
|
|
663
|
+
city: "City",
|
|
664
|
+
noStudiosFound: "No studios found in this location"
|
|
665
|
+
}
|
|
705
666
|
}) => {
|
|
706
667
|
const [currentLevel, setCurrentLevel] = React2.useState("country");
|
|
707
668
|
const [selectedCountry, setSelectedCountry] = React2.useState();
|
|
@@ -712,7 +673,7 @@ var LocationFilter = ({
|
|
|
712
673
|
const states = /* @__PURE__ */ new Map();
|
|
713
674
|
const cities = /* @__PURE__ */ new Map();
|
|
714
675
|
locations.forEach((location) => {
|
|
715
|
-
const { country, state, city } =
|
|
676
|
+
const { country, state, city } = location;
|
|
716
677
|
if (country) {
|
|
717
678
|
const existing = countries.get(country);
|
|
718
679
|
countries.set(country, {
|
|
@@ -849,7 +810,7 @@ var LocationFilter = ({
|
|
|
849
810
|
"pb-[4px] transition-colors",
|
|
850
811
|
currentLevel === "country" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]"
|
|
851
812
|
),
|
|
852
|
-
children:
|
|
813
|
+
children: pageData.country
|
|
853
814
|
}
|
|
854
815
|
),
|
|
855
816
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -862,7 +823,7 @@ var LocationFilter = ({
|
|
|
862
823
|
currentLevel === "state" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]",
|
|
863
824
|
!selectedCountry && "opacity-50 cursor-not-allowed"
|
|
864
825
|
),
|
|
865
|
-
children:
|
|
826
|
+
children: pageData.state
|
|
866
827
|
}
|
|
867
828
|
),
|
|
868
829
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -875,7 +836,7 @@ var LocationFilter = ({
|
|
|
875
836
|
currentLevel === "city" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]",
|
|
876
837
|
!selectedState && "opacity-50 cursor-not-allowed"
|
|
877
838
|
),
|
|
878
|
-
children:
|
|
839
|
+
children: pageData.city
|
|
879
840
|
}
|
|
880
841
|
)
|
|
881
842
|
] })
|
|
@@ -907,11 +868,38 @@ var LocationFilter = ({
|
|
|
907
868
|
);
|
|
908
869
|
};
|
|
909
870
|
LocationFilter.displayName = "LocationFilter";
|
|
871
|
+
var defaultPageData = {
|
|
872
|
+
title: "Find a Studio Near You",
|
|
873
|
+
loadingText: "Loading demo rooms...",
|
|
874
|
+
errorTitle: "Failed to load demo rooms",
|
|
875
|
+
machine: "eufymake E1",
|
|
876
|
+
locationFilter: {
|
|
877
|
+
allLocations: "All Locations",
|
|
878
|
+
clear: "Clear",
|
|
879
|
+
country: "Country",
|
|
880
|
+
state: "State",
|
|
881
|
+
city: "City",
|
|
882
|
+
noStudiosFound: "No studios found in this location"
|
|
883
|
+
},
|
|
884
|
+
studioCard: {
|
|
885
|
+
scheduleNow: "Schedule Now",
|
|
886
|
+
available: "Available",
|
|
887
|
+
away: "away"
|
|
888
|
+
},
|
|
889
|
+
map: {
|
|
890
|
+
apiKeyRequired: "Google Maps API Key is required",
|
|
891
|
+
loadingMap: "Loading map...",
|
|
892
|
+
scheduleNow: "Schedule Now",
|
|
893
|
+
available: "Available"
|
|
894
|
+
},
|
|
895
|
+
defaultCountry: "United States",
|
|
896
|
+
noAvailableTime: "No available time"
|
|
897
|
+
};
|
|
910
898
|
var defaultStudioLocations = [
|
|
911
899
|
{
|
|
912
900
|
id: "1",
|
|
913
901
|
name: "Design District Demo Room",
|
|
914
|
-
address: "111 8th St",
|
|
902
|
+
address: "111 8th St, San Francisco, CA, United States",
|
|
915
903
|
city: "San Francisco",
|
|
916
904
|
state: "CA",
|
|
917
905
|
zipCode: "94108",
|
|
@@ -924,7 +912,7 @@ var defaultStudioLocations = [
|
|
|
924
912
|
{
|
|
925
913
|
id: "2",
|
|
926
914
|
name: "Brooklyn Creative Studio",
|
|
927
|
-
address: "456 Broadway",
|
|
915
|
+
address: "456 Broadway, Brooklyn, NY, United States",
|
|
928
916
|
city: "Brooklyn",
|
|
929
917
|
state: "NY",
|
|
930
918
|
zipCode: "11211",
|
|
@@ -937,7 +925,7 @@ var defaultStudioLocations = [
|
|
|
937
925
|
{
|
|
938
926
|
id: "3",
|
|
939
927
|
name: "Austin Innovation Hub",
|
|
940
|
-
address: "789 Tech Blvd",
|
|
928
|
+
address: "789 Tech Blvd, Austin, TX, United States",
|
|
941
929
|
city: "Austin",
|
|
942
930
|
state: "TX",
|
|
943
931
|
zipCode: "78701",
|
|
@@ -950,7 +938,7 @@ var defaultStudioLocations = [
|
|
|
950
938
|
{
|
|
951
939
|
id: "4",
|
|
952
940
|
name: "Seattle Maker Space",
|
|
953
|
-
address: "321 Pine St",
|
|
941
|
+
address: "321 Pine St, Seattle, WA, United States",
|
|
954
942
|
city: "Seattle",
|
|
955
943
|
state: "WA",
|
|
956
944
|
zipCode: "98101",
|
|
@@ -963,7 +951,7 @@ var defaultStudioLocations = [
|
|
|
963
951
|
{
|
|
964
952
|
id: "5",
|
|
965
953
|
name: "Chicago Design Center",
|
|
966
|
-
address: "654 Michigan Ave",
|
|
954
|
+
address: "654 Michigan Ave, Chicago, IL, United States",
|
|
967
955
|
city: "Chicago",
|
|
968
956
|
state: "IL",
|
|
969
957
|
zipCode: "60611",
|
|
@@ -976,7 +964,7 @@ var defaultStudioLocations = [
|
|
|
976
964
|
{
|
|
977
965
|
id: "6",
|
|
978
966
|
name: "Miami Beach Studio",
|
|
979
|
-
address: "987 Ocean Drive",
|
|
967
|
+
address: "987 Ocean Drive, Miami Beach, FL, United States",
|
|
980
968
|
city: "Miami Beach",
|
|
981
969
|
state: "FL",
|
|
982
970
|
zipCode: "33139",
|
|
@@ -989,7 +977,7 @@ var defaultStudioLocations = [
|
|
|
989
977
|
{
|
|
990
978
|
id: "7",
|
|
991
979
|
name: "Denver Mountain Studio",
|
|
992
|
-
address: "147 16th St",
|
|
980
|
+
address: "147 16th St, Denver, CO, United States",
|
|
993
981
|
city: "Denver",
|
|
994
982
|
state: "CO",
|
|
995
983
|
zipCode: "80202",
|
|
@@ -1002,7 +990,7 @@ var defaultStudioLocations = [
|
|
|
1002
990
|
{
|
|
1003
991
|
id: "8",
|
|
1004
992
|
name: "Los Angeles Creative Lab",
|
|
1005
|
-
address: "258 Main St",
|
|
993
|
+
address: "258 Main St, Los Angeles, CA, United States",
|
|
1006
994
|
city: "Los Angeles",
|
|
1007
995
|
state: "CA",
|
|
1008
996
|
zipCode: "90012",
|
|
@@ -1020,8 +1008,22 @@ var RoomsList = ({
|
|
|
1020
1008
|
teamCode,
|
|
1021
1009
|
brandWebsite,
|
|
1022
1010
|
onSchedule,
|
|
1011
|
+
pageData,
|
|
1023
1012
|
...props
|
|
1024
1013
|
}) => {
|
|
1014
|
+
const mergedPageData = React2.useMemo(
|
|
1015
|
+
() => ({
|
|
1016
|
+
...defaultPageData,
|
|
1017
|
+
...pageData,
|
|
1018
|
+
locationFilter: {
|
|
1019
|
+
...defaultPageData.locationFilter,
|
|
1020
|
+
...pageData?.locationFilter
|
|
1021
|
+
},
|
|
1022
|
+
studioCard: { ...defaultPageData.studioCard, ...pageData?.studioCard },
|
|
1023
|
+
map: { ...defaultPageData.map, ...pageData?.map }
|
|
1024
|
+
}),
|
|
1025
|
+
[pageData]
|
|
1026
|
+
);
|
|
1025
1027
|
const [showLocationFilter, setShowLocationFilter] = React2.useState(false);
|
|
1026
1028
|
const [selectedLocation, setSelectedLocation] = React2.useState();
|
|
1027
1029
|
const [hoveredRoomId, setHoveredRoomId] = React2.useState(null);
|
|
@@ -1040,18 +1042,22 @@ var RoomsList = ({
|
|
|
1040
1042
|
const nextAvailableTimeslot = room?.timeslots?.find(
|
|
1041
1043
|
(slot) => slot.status === "available"
|
|
1042
1044
|
);
|
|
1043
|
-
const
|
|
1045
|
+
const country = room.location?.country || mergedPageData.defaultCountry;
|
|
1046
|
+
const state = room.location?.state || "";
|
|
1047
|
+
const city = room.location?.city || "";
|
|
1048
|
+
const addressParts = [room.address, city, state, country].filter(Boolean);
|
|
1049
|
+
const fullAddress = addressParts.join(", ");
|
|
1044
1050
|
return {
|
|
1045
1051
|
id: room.code,
|
|
1046
1052
|
name: room.name,
|
|
1047
|
-
address:
|
|
1053
|
+
address: fullAddress,
|
|
1048
1054
|
city,
|
|
1049
1055
|
state,
|
|
1050
1056
|
zipCode: "",
|
|
1051
1057
|
country,
|
|
1052
1058
|
lat: Number(room.latitude) || 34.0522,
|
|
1053
1059
|
lng: Number(room.longitude) || -118.2437,
|
|
1054
|
-
availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` :
|
|
1060
|
+
availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` : mergedPageData.noAvailableTime,
|
|
1055
1061
|
euifyMakeModel: room?.description
|
|
1056
1062
|
};
|
|
1057
1063
|
});
|
|
@@ -1059,25 +1065,24 @@ var RoomsList = ({
|
|
|
1059
1065
|
const filteredStudioLocations = React2.useMemo(() => {
|
|
1060
1066
|
if (!selectedLocation) return studioLocations;
|
|
1061
1067
|
return studioLocations.filter((location) => {
|
|
1062
|
-
const { country, state, city } = parseAddress(location.address);
|
|
1063
1068
|
if (selectedLocation.city) {
|
|
1064
|
-
return country === selectedLocation.country && state === selectedLocation.state && city === selectedLocation.city;
|
|
1069
|
+
return location.country === selectedLocation.country && location.state === selectedLocation.state && location.city === selectedLocation.city;
|
|
1065
1070
|
}
|
|
1066
1071
|
if (selectedLocation.state) {
|
|
1067
|
-
return country === selectedLocation.country && state === selectedLocation.state;
|
|
1072
|
+
return location.country === selectedLocation.country && location.state === selectedLocation.state;
|
|
1068
1073
|
}
|
|
1069
1074
|
if (selectedLocation.country) {
|
|
1070
|
-
return country === selectedLocation.country;
|
|
1075
|
+
return location.country === selectedLocation.country;
|
|
1071
1076
|
}
|
|
1072
1077
|
return true;
|
|
1073
1078
|
});
|
|
1074
1079
|
}, [studioLocations, selectedLocation]);
|
|
1075
1080
|
const getSelectedLocationName = () => {
|
|
1076
|
-
if (!selectedLocation) return
|
|
1081
|
+
if (!selectedLocation) return mergedPageData.locationFilter.allLocations;
|
|
1077
1082
|
if (selectedLocation.city) return selectedLocation.city;
|
|
1078
1083
|
if (selectedLocation.state) return selectedLocation.state;
|
|
1079
1084
|
if (selectedLocation.country) return selectedLocation.country;
|
|
1080
|
-
return
|
|
1085
|
+
return mergedPageData.locationFilter.allLocations;
|
|
1081
1086
|
};
|
|
1082
1087
|
const handleLocationSelect = (selection) => {
|
|
1083
1088
|
setSelectedLocation(selection);
|
|
@@ -1088,17 +1093,17 @@ var RoomsList = ({
|
|
|
1088
1093
|
};
|
|
1089
1094
|
console.log(filteredStudioLocations);
|
|
1090
1095
|
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:
|
|
1096
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title, { title: mergedPageData.title }),
|
|
1097
|
+
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
1098
|
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:
|
|
1099
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-lg font-medium", children: mergedPageData.errorTitle }),
|
|
1095
1100
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm mt-2", children: error.message })
|
|
1096
1101
|
] }) }),
|
|
1097
1102
|
!loading && !error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-[794px] gap-4", children: [
|
|
1098
1103
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1099
1104
|
"div",
|
|
1100
1105
|
{
|
|
1101
|
-
className: "flex-none relative w-[420px]",
|
|
1106
|
+
className: "flex-none relative w-[420px] l:!w-full",
|
|
1102
1107
|
style: { height: "794px" },
|
|
1103
1108
|
children: [
|
|
1104
1109
|
/* @__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,11 +1139,11 @@ var RoomsList = ({
|
|
|
1134
1139
|
{
|
|
1135
1140
|
onClick: handleClearFilter,
|
|
1136
1141
|
className: "ml-auto text-[14px] text-[#2E8B57] hover:underline",
|
|
1137
|
-
children:
|
|
1142
|
+
children: mergedPageData.locationFilter.clear
|
|
1138
1143
|
}
|
|
1139
1144
|
),
|
|
1140
1145
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex text-[#767880] cursor-not-allowed", children: [
|
|
1141
|
-
|
|
1146
|
+
mergedPageData.machine,
|
|
1142
1147
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1143
1148
|
"svg",
|
|
1144
1149
|
{
|
|
@@ -1163,7 +1168,7 @@ var RoomsList = ({
|
|
|
1163
1168
|
{
|
|
1164
1169
|
style: { maxHeight: "706px", overflow: "auto" },
|
|
1165
1170
|
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:
|
|
1171
|
+
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
1172
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1168
1173
|
StudioCard,
|
|
1169
1174
|
{
|
|
@@ -1177,7 +1182,8 @@ var RoomsList = ({
|
|
|
1177
1182
|
euifyMakeModel: item?.euifyMakeModel || "",
|
|
1178
1183
|
onSchedule,
|
|
1179
1184
|
onMouseEnter: () => setHoveredRoomId(item.id),
|
|
1180
|
-
onMouseLeave: () => setHoveredRoomId(null)
|
|
1185
|
+
onMouseLeave: () => setHoveredRoomId(null),
|
|
1186
|
+
pageData: mergedPageData.studioCard
|
|
1181
1187
|
},
|
|
1182
1188
|
item.id
|
|
1183
1189
|
);
|
|
@@ -1188,25 +1194,29 @@ var RoomsList = ({
|
|
|
1188
1194
|
LocationFilter,
|
|
1189
1195
|
{
|
|
1190
1196
|
locations: studioLocations.map((loc) => ({
|
|
1191
|
-
|
|
1192
|
-
|
|
1197
|
+
id: loc.id,
|
|
1198
|
+
country: loc.country,
|
|
1199
|
+
state: loc.state,
|
|
1200
|
+
city: loc.city
|
|
1193
1201
|
})),
|
|
1194
1202
|
visible: showLocationFilter,
|
|
1195
1203
|
onSelect: handleLocationSelect,
|
|
1196
|
-
onClose: () => setShowLocationFilter(false)
|
|
1204
|
+
onClose: () => setShowLocationFilter(false),
|
|
1205
|
+
pageData: mergedPageData.locationFilter
|
|
1197
1206
|
}
|
|
1198
1207
|
)
|
|
1199
1208
|
]
|
|
1200
1209
|
}
|
|
1201
1210
|
),
|
|
1202
|
-
googleMapsApiKey && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1211
|
+
googleMapsApiKey && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1 l:!hidden"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1203
1212
|
StudioMap,
|
|
1204
1213
|
{
|
|
1205
1214
|
googleMapsApiKey,
|
|
1206
1215
|
locations: filteredStudioLocations,
|
|
1207
1216
|
hoveredLocationId: hoveredRoomId,
|
|
1208
1217
|
onSchedule,
|
|
1209
|
-
mapHeight: "794px"
|
|
1218
|
+
mapHeight: "794px",
|
|
1219
|
+
pageData: mergedPageData.map
|
|
1210
1220
|
}
|
|
1211
1221
|
) })
|
|
1212
1222
|
] })
|
|
@@ -1388,6 +1398,7 @@ var DemoRoom = ({
|
|
|
1388
1398
|
teamCode,
|
|
1389
1399
|
brandWebsite,
|
|
1390
1400
|
onSchedule,
|
|
1401
|
+
pageData,
|
|
1391
1402
|
...props
|
|
1392
1403
|
}) => {
|
|
1393
1404
|
const apiClient = React2.useMemo(
|
|
@@ -1402,7 +1413,8 @@ var DemoRoom = ({
|
|
|
1402
1413
|
apiClient,
|
|
1403
1414
|
teamCode,
|
|
1404
1415
|
brandWebsite,
|
|
1405
|
-
onSchedule
|
|
1416
|
+
onSchedule,
|
|
1417
|
+
pageData
|
|
1406
1418
|
}
|
|
1407
1419
|
) });
|
|
1408
1420
|
};
|