@burdenoff/microfe-ggnomad 2026.825.1 → 2026.828.1
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/ggnomad/components/AvailabilityPanel.d.ts +15 -0
- package/dist/ggnomad/components/AvailabilityPanel.d.ts.map +1 -0
- package/dist/ggnomad/components/AvailabilityPanel.js +91 -0
- package/dist/ggnomad/components/AvailabilityPanel.js.map +1 -0
- package/dist/ggnomad/components/BookingPanel.d.ts +1 -3
- package/dist/ggnomad/components/BookingPanel.d.ts.map +1 -1
- package/dist/ggnomad/components/BookingPanel.js +91 -82
- package/dist/ggnomad/components/BookingPanel.js.map +1 -1
- package/dist/ggnomad/components/EcoAccessPanel.d.ts +17 -0
- package/dist/ggnomad/components/EcoAccessPanel.d.ts.map +1 -0
- package/dist/ggnomad/components/EcoAccessPanel.js +68 -0
- package/dist/ggnomad/components/EcoAccessPanel.js.map +1 -0
- package/dist/ggnomad/components/FactGrid.d.ts +18 -0
- package/dist/ggnomad/components/FactGrid.d.ts.map +1 -0
- package/dist/ggnomad/components/FactGrid.js +29 -0
- package/dist/ggnomad/components/FactGrid.js.map +1 -0
- package/dist/ggnomad/components/GroupTripPanel.d.ts +22 -0
- package/dist/ggnomad/components/GroupTripPanel.d.ts.map +1 -0
- package/dist/ggnomad/components/GroupTripPanel.js +350 -0
- package/dist/ggnomad/components/GroupTripPanel.js.map +1 -0
- package/dist/ggnomad/components/ListingFilters.d.ts +29 -0
- package/dist/ggnomad/components/ListingFilters.d.ts.map +1 -0
- package/dist/ggnomad/components/ListingFilters.js +164 -0
- package/dist/ggnomad/components/ListingFilters.js.map +1 -0
- package/dist/ggnomad/components/PhotoGallery.d.ts +15 -0
- package/dist/ggnomad/components/PhotoGallery.d.ts.map +1 -0
- package/dist/ggnomad/components/PhotoGallery.js +54 -0
- package/dist/ggnomad/components/PhotoGallery.js.map +1 -0
- package/dist/ggnomad/components/ProviderCard.d.ts +19 -0
- package/dist/ggnomad/components/ProviderCard.d.ts.map +1 -0
- package/dist/ggnomad/components/ProviderCard.js +66 -0
- package/dist/ggnomad/components/ProviderCard.js.map +1 -0
- package/dist/ggnomad/components/RatingSummary.d.ts +14 -0
- package/dist/ggnomad/components/RatingSummary.d.ts.map +1 -0
- package/dist/ggnomad/components/RatingSummary.js +32 -0
- package/dist/ggnomad/components/RatingSummary.js.map +1 -0
- package/dist/ggnomad/components/TagChips.d.ts +16 -0
- package/dist/ggnomad/components/TagChips.d.ts.map +1 -0
- package/dist/ggnomad/components/TagChips.js +20 -0
- package/dist/ggnomad/components/TagChips.js.map +1 -0
- package/dist/ggnomad/components/index.d.ts +13 -0
- package/dist/ggnomad/components/index.d.ts.map +1 -1
- package/dist/ggnomad/components/index.js +9 -0
- package/dist/ggnomad/graphql.d.ts +10 -0
- package/dist/ggnomad/graphql.d.ts.map +1 -1
- package/dist/ggnomad/graphql.js +308 -20
- package/dist/ggnomad/graphql.js.map +1 -1
- package/dist/ggnomad/pages/ActivityDetailsPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/ActivityDetailsPage.js +174 -86
- package/dist/ggnomad/pages/ActivityDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/AnalyticsPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/AnalyticsPage.js +109 -77
- package/dist/ggnomad/pages/AnalyticsPage.js.map +1 -1
- package/dist/ggnomad/pages/BookingsPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/BookingsPage.js +188 -137
- package/dist/ggnomad/pages/BookingsPage.js.map +1 -1
- package/dist/ggnomad/pages/DashboardPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/DashboardPage.js +245 -128
- package/dist/ggnomad/pages/DashboardPage.js.map +1 -1
- package/dist/ggnomad/pages/EntertainmentPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/EntertainmentPage.js +115 -53
- package/dist/ggnomad/pages/EntertainmentPage.js.map +1 -1
- package/dist/ggnomad/pages/EventDetailsPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/EventDetailsPage.js +170 -87
- package/dist/ggnomad/pages/EventDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/FavoritesPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/FavoritesPage.js +201 -84
- package/dist/ggnomad/pages/FavoritesPage.js.map +1 -1
- package/dist/ggnomad/pages/HospitalityPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/HospitalityPage.js +99 -56
- package/dist/ggnomad/pages/HospitalityPage.js.map +1 -1
- package/dist/ggnomad/pages/PropertyDetailsPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/PropertyDetailsPage.js +177 -93
- package/dist/ggnomad/pages/PropertyDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/ProviderPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/ProviderPage.js +112 -63
- package/dist/ggnomad/pages/ProviderPage.js.map +1 -1
- package/dist/ggnomad/pages/SearchPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/SearchPage.js +236 -65
- package/dist/ggnomad/pages/SearchPage.js.map +1 -1
- package/dist/ggnomad/pages/TourDetailsPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/TourDetailsPage.js +171 -86
- package/dist/ggnomad/pages/TourDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/TourismPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/TourismPage.js +108 -54
- package/dist/ggnomad/pages/TourismPage.js.map +1 -1
- package/dist/ggnomad/pages/TravelPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/TravelPage.js +406 -43
- package/dist/ggnomad/pages/TravelPage.js.map +1 -1
- package/dist/ggnomad/pages/TripPlanDetailPage.d.ts.map +1 -1
- package/dist/ggnomad/pages/TripPlanDetailPage.js +93 -70
- package/dist/ggnomad/pages/TripPlanDetailPage.js.map +1 -1
- package/dist/ggnomad/utils/format.d.ts +47 -0
- package/dist/ggnomad/utils/format.d.ts.map +1 -0
- package/dist/ggnomad/utils/format.js +125 -0
- package/dist/ggnomad/utils/format.js.map +1 -0
- package/dist/stories/BookingPanel.stories.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,149 +1,233 @@
|
|
|
1
1
|
import { GGNOMAD_PROPERTY_QUERY as e } from "../graphql.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { jsonFacts as t } from "../utils/format.js";
|
|
3
|
+
import { PageShell as n } from "./PageShell.js";
|
|
4
|
+
import { StatusBadge as r } from "../components/StatusBadge.js";
|
|
5
|
+
import { SectionCard as i } from "../components/SectionCard.js";
|
|
6
|
+
import { DetailRow as a } from "../components/DetailRow.js";
|
|
7
|
+
import { DetailHero as o } from "../components/DetailHero.js";
|
|
8
|
+
import { useGGNomad as s } from "../providers/GGNomadProvider.js";
|
|
9
|
+
import { joinPath as c } from "../utils/navigation.js";
|
|
10
|
+
import { BookingPanel as l } from "../components/BookingPanel.js";
|
|
11
|
+
import { ReviewsSection as u } from "../components/ReviewsSection.js";
|
|
12
|
+
import { ListingEditDialog as d } from "../components/ListingEditDialog.js";
|
|
13
|
+
import { PhotoGallery as f } from "../components/PhotoGallery.js";
|
|
14
|
+
import { TagChips as p } from "../components/TagChips.js";
|
|
15
|
+
import { FactGrid as m } from "../components/FactGrid.js";
|
|
16
|
+
import { RatingSummary as h } from "../components/RatingSummary.js";
|
|
17
|
+
import { EcoAccessPanel as g } from "../components/EcoAccessPanel.js";
|
|
18
|
+
import { ProviderCard as _ } from "../components/ProviderCard.js";
|
|
19
|
+
import { AvailabilityPanel as v } from "../components/AvailabilityPanel.js";
|
|
11
20
|
import "../components/index.js";
|
|
12
|
-
import { useState as
|
|
13
|
-
import { Hotel as
|
|
14
|
-
import { useI18n as
|
|
15
|
-
import { useNavigate as
|
|
16
|
-
import { useQuery as
|
|
17
|
-
import { GlassCard as
|
|
18
|
-
import { Fragment as
|
|
21
|
+
import { useState as y } from "react";
|
|
22
|
+
import { Bath as b, BedDouble as x, Hotel as S, LogIn as C, LogOut as w, Pencil as T, Users as E, Zap as D } from "lucide-react";
|
|
23
|
+
import { useI18n as O } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
24
|
+
import { useNavigate as k, useParams as A } from "react-router";
|
|
25
|
+
import { useQuery as j } from "@apollo/client/react";
|
|
26
|
+
import { GlassCard as M, IllustratedEmptyState as N, NextSteps as P, PagePurpose as F } from "@burdenoff/fe-libs/ui";
|
|
27
|
+
import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
19
28
|
//#region src/ggnomad/pages/PropertyDetailsPage.tsx
|
|
20
|
-
function
|
|
21
|
-
let { t:
|
|
22
|
-
variables: { id:
|
|
23
|
-
skip: !
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
function z() {
|
|
30
|
+
let { t: z } = O(), B = k(), { basePath: V = "/" } = s(), { id: H = "" } = A(), [U, W] = y(!1), { data: G, refetch: K } = j(e, {
|
|
31
|
+
variables: { id: H },
|
|
32
|
+
skip: !H
|
|
33
|
+
}), q = G?.ggnomadProperty, J = [];
|
|
34
|
+
q && (J.push({
|
|
35
|
+
id: "guests",
|
|
36
|
+
label: z("ggnomad.property.guests", "Guests"),
|
|
37
|
+
value: String(q.maxGuests),
|
|
38
|
+
icon: /* @__PURE__ */ L(E, {})
|
|
39
|
+
}), q.bedrooms !== null && q.bedrooms !== void 0 && J.push({
|
|
40
|
+
id: "bedrooms",
|
|
41
|
+
label: z("ggnomad.property.bedrooms", "Bedrooms"),
|
|
42
|
+
value: String(q.bedrooms),
|
|
43
|
+
icon: /* @__PURE__ */ L(x, {})
|
|
44
|
+
}), q.bathrooms !== null && q.bathrooms !== void 0 && J.push({
|
|
45
|
+
id: "bathrooms",
|
|
46
|
+
label: z("ggnomad.property.bathrooms", "Bathrooms"),
|
|
47
|
+
value: String(q.bathrooms),
|
|
48
|
+
icon: /* @__PURE__ */ L(b, {})
|
|
49
|
+
}), q.checkInTime && J.push({
|
|
50
|
+
id: "check-in",
|
|
51
|
+
label: z("ggnomad.property.checkInTime", "Check-in"),
|
|
52
|
+
value: q.checkInTime,
|
|
53
|
+
icon: /* @__PURE__ */ L(C, {})
|
|
54
|
+
}), q.checkOutTime && J.push({
|
|
55
|
+
id: "check-out",
|
|
56
|
+
label: z("ggnomad.property.checkOutTime", "Check-out"),
|
|
57
|
+
value: q.checkOutTime,
|
|
58
|
+
icon: /* @__PURE__ */ L(w, {})
|
|
59
|
+
}));
|
|
60
|
+
let Y = t(q?.address);
|
|
61
|
+
return /* @__PURE__ */ L(n, {
|
|
62
|
+
title: q?.name ?? z("ggnomad.property.fallbackTitle", "Property details"),
|
|
63
|
+
subtitle: z("ggnomad.property.subtitle", "Detailed hospitality listing view"),
|
|
64
|
+
children: q ? /* @__PURE__ */ R(I, { children: [
|
|
65
|
+
q.images.length > 0 ? /* @__PURE__ */ L(f, {
|
|
66
|
+
images: q.images,
|
|
67
|
+
alt: q.name
|
|
68
|
+
}) : /* @__PURE__ */ L(o, { alt: q.name }),
|
|
69
|
+
/* @__PURE__ */ R("div", {
|
|
70
|
+
className: "flex flex-wrap items-center gap-3",
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ L("span", {
|
|
73
|
+
className: "rounded-full border border-border-seam bg-bg-sunken px-3 py-1 text-sm text-text-primary",
|
|
74
|
+
children: q.type
|
|
75
|
+
}),
|
|
76
|
+
q.status ? /* @__PURE__ */ L(r, { status: q.status }) : null,
|
|
77
|
+
/* @__PURE__ */ L(h, {
|
|
78
|
+
rating: q.rating,
|
|
79
|
+
reviewCount: q.reviewCount
|
|
80
|
+
}),
|
|
81
|
+
q.instantBook ? /* @__PURE__ */ R("span", {
|
|
82
|
+
className: "inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-3 py-1 text-sm font-medium text-status-success-text",
|
|
83
|
+
children: [/* @__PURE__ */ L(D, {
|
|
84
|
+
className: "size-3.5",
|
|
85
|
+
"aria-hidden": "true"
|
|
86
|
+
}), z("ggnomad.listing.instantBook", "Instant book")]
|
|
87
|
+
}) : null
|
|
88
|
+
]
|
|
32
89
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
icon: /* @__PURE__ */ S
|
|
35
|
-
children:
|
|
90
|
+
/* @__PURE__ */ L(F, {
|
|
91
|
+
icon: /* @__PURE__ */ L(S, { className: "size-4" }),
|
|
92
|
+
children: z("ggnomad.property.purpose", "Everything you need to decide on this stay — its type, description, nightly price, guest capacity, rating and the provider behind it — before you reserve it.")
|
|
36
93
|
}),
|
|
37
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ L(m, { facts: J }),
|
|
95
|
+
/* @__PURE__ */ L(P, {
|
|
38
96
|
storageKey: "ggnomad-property-detail",
|
|
39
97
|
steps: [{
|
|
40
98
|
id: "browse",
|
|
41
|
-
label:
|
|
42
|
-
description:
|
|
43
|
-
icon: /* @__PURE__ */ S
|
|
44
|
-
onClick: () =>
|
|
99
|
+
label: z("ggnomad.property.next.browse", "Compare other stays"),
|
|
100
|
+
description: z("ggnomad.property.next.browseDesc", "Go back to hospitality listings to compare options."),
|
|
101
|
+
icon: /* @__PURE__ */ L(S, { className: "size-4" }),
|
|
102
|
+
onClick: () => B(c(V, "hospitality"))
|
|
45
103
|
}]
|
|
46
104
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ R("div", {
|
|
48
106
|
className: "grid gap-4 lg:grid-cols-3",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ R("div", {
|
|
50
108
|
className: "lg:col-span-2 space-y-4",
|
|
51
109
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
title:
|
|
110
|
+
/* @__PURE__ */ R(i, {
|
|
111
|
+
title: z("ggnomad.property.about", "About"),
|
|
54
112
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ L("p", {
|
|
56
114
|
className: "text-sm text-text-secondary",
|
|
57
|
-
children:
|
|
115
|
+
children: z("ggnomad.property.type", "Type")
|
|
58
116
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ L("p", {
|
|
60
118
|
className: "text-text-primary",
|
|
61
|
-
children:
|
|
119
|
+
children: q.type
|
|
62
120
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ L("p", {
|
|
64
122
|
className: "mt-3 text-sm text-text-secondary",
|
|
65
|
-
children:
|
|
123
|
+
children: z("ggnomad.property.description", "Description")
|
|
66
124
|
}),
|
|
67
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ L("p", {
|
|
68
126
|
className: "text-text-primary",
|
|
69
|
-
children:
|
|
70
|
-
})
|
|
127
|
+
children: q.description ?? z("ggnomad.property.noDescription", "No description")
|
|
128
|
+
}),
|
|
129
|
+
Y.length > 0 ? /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L("p", {
|
|
130
|
+
className: "mt-3 text-sm text-text-secondary",
|
|
131
|
+
children: z("ggnomad.property.address", "Address")
|
|
132
|
+
}), /* @__PURE__ */ L("dl", {
|
|
133
|
+
className: "mt-1 space-y-1 text-sm",
|
|
134
|
+
children: Y.map((e) => /* @__PURE__ */ L(a, {
|
|
135
|
+
label: e.label,
|
|
136
|
+
value: e.value
|
|
137
|
+
}, e.key))
|
|
138
|
+
})] }) : null
|
|
71
139
|
]
|
|
72
140
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
141
|
+
q.amenities.length > 0 ? /* @__PURE__ */ L(i, {
|
|
142
|
+
title: z("ggnomad.property.amenities", "Amenities"),
|
|
143
|
+
children: /* @__PURE__ */ L(p, { items: q.amenities })
|
|
144
|
+
}) : null,
|
|
145
|
+
/* @__PURE__ */ R(M, {
|
|
74
146
|
treatment: "glass",
|
|
75
147
|
glow: !0,
|
|
76
148
|
className: "border-border-seam p-5",
|
|
77
|
-
children: [/* @__PURE__ */
|
|
149
|
+
children: [/* @__PURE__ */ R("div", {
|
|
78
150
|
className: "mb-4 flex items-center justify-between gap-3",
|
|
79
|
-
children: [/* @__PURE__ */
|
|
151
|
+
children: [/* @__PURE__ */ L("h2", {
|
|
80
152
|
className: "text-lg font-medium tracking-tight text-text-primary",
|
|
81
|
-
children:
|
|
82
|
-
}), /* @__PURE__ */
|
|
83
|
-
onClick: () =>
|
|
153
|
+
children: z("ggnomad.property.details", "Details")
|
|
154
|
+
}), /* @__PURE__ */ L("button", {
|
|
155
|
+
onClick: () => W(!0),
|
|
84
156
|
className: "rounded-md p-2 text-text-secondary hover:bg-action-primary-bg hover:text-action-primary-text",
|
|
85
|
-
"aria-label":
|
|
86
|
-
title:
|
|
87
|
-
children: /* @__PURE__ */
|
|
157
|
+
"aria-label": z("ggnomad.property.editListing", "Edit listing"),
|
|
158
|
+
title: z("ggnomad.property.editListing", "Edit listing"),
|
|
159
|
+
children: /* @__PURE__ */ L(T, { className: "size-4" })
|
|
88
160
|
})]
|
|
89
|
-
}), /* @__PURE__ */
|
|
161
|
+
}), /* @__PURE__ */ R("dl", {
|
|
90
162
|
className: "space-y-2 text-sm",
|
|
91
163
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
label:
|
|
94
|
-
value: `${
|
|
164
|
+
/* @__PURE__ */ L(a, {
|
|
165
|
+
label: z("ggnomad.property.price", "Price per night"),
|
|
166
|
+
value: `${q.currency} ${Number(q.pricePerNight).toFixed(2)}`
|
|
95
167
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
label:
|
|
98
|
-
value: String(
|
|
168
|
+
/* @__PURE__ */ L(a, {
|
|
169
|
+
label: z("ggnomad.property.guests", "Guests"),
|
|
170
|
+
value: String(q.maxGuests)
|
|
99
171
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
label:
|
|
102
|
-
value:
|
|
172
|
+
/* @__PURE__ */ L(a, {
|
|
173
|
+
label: z("ggnomad.property.rating", "Rating"),
|
|
174
|
+
value: /* @__PURE__ */ L(h, {
|
|
175
|
+
rating: q.rating,
|
|
176
|
+
reviewCount: q.reviewCount
|
|
177
|
+
})
|
|
103
178
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
label:
|
|
106
|
-
value:
|
|
179
|
+
/* @__PURE__ */ L(a, {
|
|
180
|
+
label: z("ggnomad.property.provider", "Provider"),
|
|
181
|
+
value: q.provider?.name ?? z("ggnomad.property.unassigned", "Unassigned")
|
|
107
182
|
})
|
|
108
183
|
]
|
|
109
184
|
})]
|
|
110
185
|
}),
|
|
111
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ L(g, {
|
|
187
|
+
sustainabilityScore: q.sustainabilityScore,
|
|
188
|
+
sustainabilityPractices: q.sustainabilityPractices,
|
|
189
|
+
accessibilityFeatures: q.accessibilityFeatures
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ L(v, {
|
|
192
|
+
listingId: q.id ?? H,
|
|
193
|
+
listingType: "PROPERTY"
|
|
194
|
+
}),
|
|
195
|
+
q.provider ? /* @__PURE__ */ L(_, { provider: q.provider }) : null,
|
|
196
|
+
/* @__PURE__ */ L(u, {
|
|
112
197
|
targetType: "PROPERTY",
|
|
113
|
-
targetId:
|
|
198
|
+
targetId: q.id ?? H
|
|
114
199
|
})
|
|
115
200
|
]
|
|
116
|
-
}), /* @__PURE__ */
|
|
201
|
+
}), /* @__PURE__ */ L("div", { children: /* @__PURE__ */ L(l, {
|
|
117
202
|
bookingType: "PROPERTY",
|
|
118
|
-
itemId:
|
|
119
|
-
itemName:
|
|
120
|
-
unitPrice:
|
|
121
|
-
currency:
|
|
122
|
-
nights: 1
|
|
203
|
+
itemId: q.id ?? H,
|
|
204
|
+
itemName: q.name,
|
|
205
|
+
unitPrice: q.pricePerNight ?? 0,
|
|
206
|
+
currency: q.currency ?? "USD"
|
|
123
207
|
}) })]
|
|
124
208
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
open:
|
|
127
|
-
onOpenChange:
|
|
209
|
+
/* @__PURE__ */ L(d, {
|
|
210
|
+
open: U,
|
|
211
|
+
onOpenChange: W,
|
|
128
212
|
targetType: "PROPERTY",
|
|
129
|
-
id:
|
|
213
|
+
id: q.id ?? H,
|
|
130
214
|
initial: {
|
|
131
|
-
name:
|
|
132
|
-
description:
|
|
133
|
-
pricePerNight:
|
|
134
|
-
status:
|
|
135
|
-
images:
|
|
215
|
+
name: q.name,
|
|
216
|
+
description: q.description ?? void 0,
|
|
217
|
+
pricePerNight: q.pricePerNight,
|
|
218
|
+
status: q.status,
|
|
219
|
+
images: q.images
|
|
136
220
|
},
|
|
137
|
-
onSaved: () =>
|
|
221
|
+
onSaved: () => K()
|
|
138
222
|
})
|
|
139
|
-
] }) : /* @__PURE__ */
|
|
223
|
+
] }) : /* @__PURE__ */ L(N, {
|
|
140
224
|
illustration: "empty-data",
|
|
141
|
-
title:
|
|
142
|
-
description:
|
|
225
|
+
title: z("ggnomad.property.notFoundTitle", "No property found"),
|
|
226
|
+
description: z("ggnomad.property.notFoundDescription", "This property is unavailable or may have been removed.")
|
|
143
227
|
})
|
|
144
228
|
});
|
|
145
229
|
}
|
|
146
230
|
//#endregion
|
|
147
|
-
export {
|
|
231
|
+
export { z as PropertyDetailsPage };
|
|
148
232
|
|
|
149
233
|
//# sourceMappingURL=PropertyDetailsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyDetailsPage.js","names":[],"sources":["../../../src/ggnomad/pages/PropertyDetailsPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useQuery } from '@apollo/client/react';\nimport type { TypedDocumentNode } from '@apollo/client';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useNavigate, useParams } from 'react-router';\nimport { Hotel, Pencil } from 'lucide-react';\nimport { GlassCard, IllustratedEmptyState, NextSteps, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nimport { GGNOMAD_PROPERTY_QUERY } from '../graphql';\nimport { useGGNomad } from '../providers/GGNomadProvider';\nimport { joinPath } from '../utils/navigation';\nimport { PageShell } from './PageShell';\nimport {\n DetailRow,\n SectionCard,\n DetailHero,\n BookingPanel,\n ReviewsSection,\n ListingEditDialog,\n} from '../components';\n\nexport function PropertyDetailsPage() {\n const { t } = useI18n();\n const navigate = useNavigate();\n const { basePath = '/' } = useGGNomad();\n const { id = '' } = useParams();\n const [editDialogOpen, setEditDialogOpen] = useState(false);\n const { data, refetch } = useQuery(\n GGNOMAD_PROPERTY_QUERY as TypedDocumentNode<\n {\n ggnomadProperty: {\n id: string;\n name: string;\n type: string;\n description?: string;\n currency: string;\n pricePerNight: number;\n status?: string;\n maxGuests: number;\n rating?: number;\n provider?: { name: string };\n images?: string[];\n } | null;\n },\n { id: string }\n >,\n { variables: { id }, skip: !id }\n );\n const property = data?.ggnomadProperty;\n\n return (\n <PageShell\n title={property?.name ?? t('ggnomad.property.fallbackTitle', 'Property details')}\n subtitle={t('ggnomad.property.subtitle', 'Detailed hospitality listing view')}\n >\n {!property ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={t('ggnomad.property.notFoundTitle', 'No property found')}\n description={t(\n 'ggnomad.property.notFoundDescription',\n 'This property is unavailable or may have been removed.'\n )}\n />\n ) : (\n <>\n <DetailHero image={property.images?.[0]} alt={property.name} />\n <PagePurpose icon={<Hotel className=\"size-4\" />}>\n {t(\n 'ggnomad.property.purpose',\n 'Everything you need to decide on this stay — its type, description, nightly price, guest capacity, rating and the provider behind it — before you reserve it.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"ggnomad-property-detail\"\n steps={[\n {\n id: 'browse',\n label: t('ggnomad.property.next.browse', 'Compare other stays'),\n description: t(\n 'ggnomad.property.next.browseDesc',\n 'Go back to hospitality listings to compare options.'\n ),\n icon: <Hotel className=\"size-4\" />,\n onClick: () => navigate(joinPath(basePath, 'hospitality')),\n },\n ]}\n />\n\n <div className=\"grid gap-4 lg:grid-cols-3\">\n <div className=\"lg:col-span-2 space-y-4\">\n <SectionCard title={t('ggnomad.property.about', 'About')}>\n <p className=\"text-sm text-text-secondary\">{t('ggnomad.property.type', 'Type')}</p>\n <p className=\"text-text-primary\">{property.type}</p>\n <p className=\"mt-3 text-sm text-text-secondary\">\n {t('ggnomad.property.description', 'Description')}\n </p>\n <p className=\"text-text-primary\">\n {property.description ?? t('ggnomad.property.noDescription', 'No description')}\n </p>\n </SectionCard>\n <GlassCard treatment=\"glass\" glow className=\"border-border-seam p-5\">\n <div className=\"mb-4 flex items-center justify-between gap-3\">\n <h2 className=\"text-lg font-medium tracking-tight text-text-primary\">\n {t('ggnomad.property.details', 'Details')}\n </h2>\n <button\n onClick={() => setEditDialogOpen(true)}\n className=\"rounded-md p-2 text-text-secondary hover:bg-action-primary-bg hover:text-action-primary-text\"\n aria-label={t('ggnomad.property.editListing', 'Edit listing')}\n title={t('ggnomad.property.editListing', 'Edit listing')}\n >\n <Pencil className=\"size-4\" />\n </button>\n </div>\n <dl className=\"space-y-2 text-sm\">\n <DetailRow\n label={t('ggnomad.property.price', 'Price')}\n value={`${property.currency} ${Number(property.pricePerNight).toFixed(2)}`}\n />\n <DetailRow\n label={t('ggnomad.property.guests', 'Guests')}\n value={String(property.maxGuests)}\n />\n <DetailRow\n label={t('ggnomad.property.rating', 'Rating')}\n value={String(property.rating ?? t('ggnomad.property.noRating', 'N/A'))}\n />\n <DetailRow\n label={t('ggnomad.property.provider', 'Provider')}\n value={\n property.provider?.name ?? t('ggnomad.property.unassigned', 'Unassigned')\n }\n />\n </dl>\n </GlassCard>\n <ReviewsSection targetType=\"PROPERTY\" targetId={property.id ?? id} />\n </div>\n <div>\n <BookingPanel\n bookingType=\"PROPERTY\"\n itemId={property.id ?? id}\n itemName={property.name}\n unitPrice={property.pricePerNight ?? 0}\n currency={property.currency ?? 'USD'}\n nights={1}\n />\n </div>\n </div>\n\n <ListingEditDialog\n open={editDialogOpen}\n onOpenChange={setEditDialogOpen}\n targetType=\"PROPERTY\"\n id={property.id ?? id}\n initial={{\n name: property.name,\n description: property.description,\n pricePerNight: property.pricePerNight,\n status: property.status,\n images: property.images,\n }}\n onSaved={() => refetch()}\n />\n </>\n )}\n </PageShell>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,IAAsB;CACpC,IAAM,EAAE,SAAM,EAAQ,GAChB,IAAW,EAAY,GACvB,EAAE,cAAW,QAAQ,EAAW,GAChC,EAAE,QAAK,OAAO,EAAU,GACxB,CAAC,GAAgB,KAAqB,EAAS,EAAK,GACpD,EAAE,SAAM,eAAY,EACxB,GAkBA;EAAE,WAAW,EAAE,MAAG;EAAG,MAAM,CAAC;CAAG,CACjC,GACM,IAAW,GAAM;CAEvB,OACE,kBAAC,GAAD;EACE,OAAO,GAAU,QAAQ,EAAE,kCAAkC,kBAAkB;EAC/E,UAAU,EAAE,6BAA6B,mCAAmC;YAE1E,IAUA,kBAAA,GAAA,EAAA,UAAA;GACE,kBAAC,GAAD;IAAY,OAAO,EAAS,SAAS;IAAI,KAAK,EAAS;GAAO,CAAA;GAC9D,kBAAC,GAAD;IAAa,MAAM,kBAAC,GAAD,EAAO,WAAU,SAAU,CAAA;cAC3C,EACC,4BACA,+JACF;GACW,CAAA;GAEb,kBAAC,GAAD;IACE,YAAW;IACX,OAAO,CACL;KACE,IAAI;KACJ,OAAO,EAAE,gCAAgC,qBAAqB;KAC9D,aAAa,EACX,oCACA,qDACF;KACA,MAAM,kBAAC,GAAD,EAAO,WAAU,SAAU,CAAA;KACjC,eAAe,EAAS,EAAS,GAAU,aAAa,CAAC;IAC3D,CACF;GACD,CAAA;GAED,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAA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AAD;OAAgB,YAAW;OAAW,UAAU,EAAS,MAAM;MAAK,CAAA;KACjE;QACL,kBAAC,OAAD,EAAA,UACE,kBAAC,GAAD;KACE,aAAY;KACZ,QAAQ,EAAS,MAAM;KACvB,UAAU,EAAS;KACnB,WAAW,EAAS,iBAAiB;KACrC,UAAU,EAAS,YAAY;KAC/B,QAAQ;IACT,CAAA,EACE,CAAA,CACF;;GAEL,kBAAC,GAAD;IACE,MAAM;IACN,cAAc;IACd,YAAW;IACX,IAAI,EAAS,MAAM;IACnB,SAAS;KACP,MAAM,EAAS;KACf,aAAa,EAAS;KACtB,eAAe,EAAS;KACxB,QAAQ,EAAS;KACjB,QAAQ,EAAS;IACnB;IACA,eAAe,EAAQ;GACxB,CAAA;EACD,EAAA,CAAA,IA7GF,kBAAC,GAAD;GACE,cAAa;GACb,OAAO,EAAE,kCAAkC,mBAAmB;GAC9D,aAAa,EACX,wCACA,wDACF;EACD,CAAA;CAwGM,CAAA;AAEf"}
|
|
1
|
+
{"version":3,"file":"PropertyDetailsPage.js","names":[],"sources":["../../../src/ggnomad/pages/PropertyDetailsPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useQuery } from '@apollo/client/react';\nimport type { TypedDocumentNode } from '@apollo/client';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useNavigate, useParams } from 'react-router';\nimport { Bath, BedDouble, Hotel, LogIn, LogOut, Pencil, Users, Zap } from 'lucide-react';\nimport { GlassCard, IllustratedEmptyState, NextSteps, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nimport { GGNOMAD_PROPERTY_QUERY } from '../graphql';\nimport { useGGNomad } from '../providers/GGNomadProvider';\nimport { joinPath } from '../utils/navigation';\nimport { jsonFacts } from '../utils/format';\nimport { PageShell } from './PageShell';\nimport {\n AvailabilityPanel,\n BookingPanel,\n DetailHero,\n DetailRow,\n EcoAccessPanel,\n FactGrid,\n ListingEditDialog,\n PhotoGallery,\n ProviderCard,\n RatingSummary,\n ReviewsSection,\n SectionCard,\n StatusBadge,\n TagChips,\n} from '../components';\nimport type { Fact } from '../components';\n\ntype PropertyDetail = {\n id: string;\n name: string;\n type: string;\n status?: string;\n description?: string | null;\n address?: unknown;\n currency: string;\n pricePerNight: number;\n rating?: number | null;\n reviewCount: number;\n bedrooms?: number | null;\n bathrooms?: number | null;\n maxGuests: number;\n checkInTime?: string | null;\n checkOutTime?: string | null;\n amenities: string[];\n images: string[];\n instantBook: boolean;\n sustainabilityScore: number;\n sustainabilityPractices: string[];\n accessibilityFeatures: string[];\n provider?: {\n id: string;\n name: string;\n type?: string | null;\n rating?: number | null;\n reviewCount?: number | null;\n listingCount?: number | null;\n contactEmail?: string | null;\n website?: string | null;\n } | null;\n};\n\nexport function PropertyDetailsPage() {\n const { t } = useI18n();\n const navigate = useNavigate();\n const { basePath = '/' } = useGGNomad();\n const { id = '' } = useParams();\n const [editDialogOpen, setEditDialogOpen] = useState(false);\n const { data, refetch } = useQuery(\n GGNOMAD_PROPERTY_QUERY as TypedDocumentNode<\n { ggnomadProperty: PropertyDetail | null },\n { id: string }\n >,\n { variables: { id }, skip: !id }\n );\n const property = data?.ggnomadProperty;\n\n const facts: Fact[] = [];\n if (property) {\n facts.push({\n id: 'guests',\n label: t('ggnomad.property.guests', 'Guests'),\n value: String(property.maxGuests),\n icon: <Users />,\n });\n if (property.bedrooms !== null && property.bedrooms !== undefined) {\n facts.push({\n id: 'bedrooms',\n label: t('ggnomad.property.bedrooms', 'Bedrooms'),\n value: String(property.bedrooms),\n icon: <BedDouble />,\n });\n }\n if (property.bathrooms !== null && property.bathrooms !== undefined) {\n facts.push({\n id: 'bathrooms',\n label: t('ggnomad.property.bathrooms', 'Bathrooms'),\n value: String(property.bathrooms),\n icon: <Bath />,\n });\n }\n if (property.checkInTime) {\n facts.push({\n id: 'check-in',\n label: t('ggnomad.property.checkInTime', 'Check-in'),\n value: property.checkInTime,\n icon: <LogIn />,\n });\n }\n if (property.checkOutTime) {\n facts.push({\n id: 'check-out',\n label: t('ggnomad.property.checkOutTime', 'Check-out'),\n value: property.checkOutTime,\n icon: <LogOut />,\n });\n }\n }\n\n const addressFacts = jsonFacts(property?.address);\n\n return (\n <PageShell\n title={property?.name ?? t('ggnomad.property.fallbackTitle', 'Property details')}\n subtitle={t('ggnomad.property.subtitle', 'Detailed hospitality listing view')}\n >\n {!property ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={t('ggnomad.property.notFoundTitle', 'No property found')}\n description={t(\n 'ggnomad.property.notFoundDescription',\n 'This property is unavailable or may have been removed.'\n )}\n />\n ) : (\n <>\n {property.images.length > 0 ? (\n <PhotoGallery images={property.images} alt={property.name} />\n ) : (\n <DetailHero alt={property.name} />\n )}\n\n <div className=\"flex flex-wrap items-center gap-3\">\n <span className=\"rounded-full border border-border-seam bg-bg-sunken px-3 py-1 text-sm text-text-primary\">\n {property.type}\n </span>\n {property.status ? <StatusBadge status={property.status} /> : null}\n <RatingSummary rating={property.rating} reviewCount={property.reviewCount} />\n {property.instantBook ? (\n <span className=\"inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-3 py-1 text-sm font-medium text-status-success-text\">\n <Zap className=\"size-3.5\" aria-hidden=\"true\" />\n {t('ggnomad.listing.instantBook', 'Instant book')}\n </span>\n ) : null}\n </div>\n\n <PagePurpose icon={<Hotel className=\"size-4\" />}>\n {t(\n 'ggnomad.property.purpose',\n 'Everything you need to decide on this stay — its type, description, nightly price, guest capacity, rating and the provider behind it — before you reserve it.'\n )}\n </PagePurpose>\n\n <FactGrid facts={facts} />\n\n <NextSteps\n storageKey=\"ggnomad-property-detail\"\n steps={[\n {\n id: 'browse',\n label: t('ggnomad.property.next.browse', 'Compare other stays'),\n description: t(\n 'ggnomad.property.next.browseDesc',\n 'Go back to hospitality listings to compare options.'\n ),\n icon: <Hotel className=\"size-4\" />,\n onClick: () => navigate(joinPath(basePath, 'hospitality')),\n },\n ]}\n />\n\n <div className=\"grid gap-4 lg:grid-cols-3\">\n <div className=\"lg:col-span-2 space-y-4\">\n <SectionCard title={t('ggnomad.property.about', 'About')}>\n <p className=\"text-sm text-text-secondary\">{t('ggnomad.property.type', 'Type')}</p>\n <p className=\"text-text-primary\">{property.type}</p>\n <p className=\"mt-3 text-sm text-text-secondary\">\n {t('ggnomad.property.description', 'Description')}\n </p>\n <p className=\"text-text-primary\">\n {property.description ?? t('ggnomad.property.noDescription', 'No description')}\n </p>\n {addressFacts.length > 0 ? (\n <>\n <p className=\"mt-3 text-sm text-text-secondary\">\n {t('ggnomad.property.address', 'Address')}\n </p>\n <dl className=\"mt-1 space-y-1 text-sm\">\n {addressFacts.map((fact) => (\n <DetailRow key={fact.key} label={fact.label} value={fact.value} />\n ))}\n </dl>\n </>\n ) : null}\n </SectionCard>\n\n {property.amenities.length > 0 ? (\n <SectionCard title={t('ggnomad.property.amenities', 'Amenities')}>\n <TagChips items={property.amenities} />\n </SectionCard>\n ) : null}\n\n <GlassCard treatment=\"glass\" glow className=\"border-border-seam p-5\">\n <div className=\"mb-4 flex items-center justify-between gap-3\">\n <h2 className=\"text-lg font-medium tracking-tight text-text-primary\">\n {t('ggnomad.property.details', 'Details')}\n </h2>\n <button\n onClick={() => setEditDialogOpen(true)}\n className=\"rounded-md p-2 text-text-secondary hover:bg-action-primary-bg hover:text-action-primary-text\"\n aria-label={t('ggnomad.property.editListing', 'Edit listing')}\n title={t('ggnomad.property.editListing', 'Edit listing')}\n >\n <Pencil className=\"size-4\" />\n </button>\n </div>\n <dl className=\"space-y-2 text-sm\">\n <DetailRow\n label={t('ggnomad.property.price', 'Price per night')}\n value={`${property.currency} ${Number(property.pricePerNight).toFixed(2)}`}\n />\n <DetailRow\n label={t('ggnomad.property.guests', 'Guests')}\n value={String(property.maxGuests)}\n />\n <DetailRow\n label={t('ggnomad.property.rating', 'Rating')}\n value={\n <RatingSummary rating={property.rating} reviewCount={property.reviewCount} />\n }\n />\n <DetailRow\n label={t('ggnomad.property.provider', 'Provider')}\n value={\n property.provider?.name ?? t('ggnomad.property.unassigned', 'Unassigned')\n }\n />\n </dl>\n </GlassCard>\n\n <EcoAccessPanel\n sustainabilityScore={property.sustainabilityScore}\n sustainabilityPractices={property.sustainabilityPractices}\n accessibilityFeatures={property.accessibilityFeatures}\n />\n\n <AvailabilityPanel listingId={property.id ?? id} listingType=\"PROPERTY\" />\n\n {property.provider ? <ProviderCard provider={property.provider} /> : null}\n\n <ReviewsSection targetType=\"PROPERTY\" targetId={property.id ?? id} />\n </div>\n <div>\n <BookingPanel\n bookingType=\"PROPERTY\"\n itemId={property.id ?? id}\n itemName={property.name}\n unitPrice={property.pricePerNight ?? 0}\n currency={property.currency ?? 'USD'}\n />\n </div>\n </div>\n\n <ListingEditDialog\n open={editDialogOpen}\n onOpenChange={setEditDialogOpen}\n targetType=\"PROPERTY\"\n id={property.id ?? id}\n initial={{\n name: property.name,\n description: property.description ?? undefined,\n pricePerNight: property.pricePerNight,\n status: property.status,\n images: property.images,\n }}\n onSaved={() => refetch()}\n />\n </>\n )}\n </PageShell>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,SAAgB,IAAsB;CACpC,IAAM,EAAE,SAAM,EAAQ,GAChB,IAAW,EAAY,GACvB,EAAE,cAAW,QAAQ,EAAW,GAChC,EAAE,QAAK,OAAO,EAAU,GACxB,CAAC,GAAgB,KAAqB,EAAS,EAAK,GACpD,EAAE,SAAM,eAAY,EACxB,GAIA;EAAE,WAAW,EAAE,MAAG;EAAG,MAAM,CAAC;CAAG,CACjC,GACM,IAAW,GAAM,iBAEjB,IAAgB,CAAC;CACvB,AAAI,MACF,EAAM,KAAK;EACT,IAAI;EACJ,OAAO,EAAE,2BAA2B,QAAQ;EAC5C,OAAO,OAAO,EAAS,SAAS;EAChC,MAAM,kBAAC,GAAD,CAAQ,CAAA;CAChB,CAAC,GACG,EAAS,aAAa,QAAQ,EAAS,aAAa,KAAA,KACtD,EAAM,KAAK;EACT,IAAI;EACJ,OAAO,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A;KACjE;QACL,kBAAC,OAAD,EAAA,UACE,kBAAC,GAAD;KACE,aAAY;KACZ,QAAQ,EAAS,MAAM;KACvB,UAAU,EAAS;KACnB,WAAW,EAAS,iBAAiB;KACrC,UAAU,EAAS,YAAY;IAChC,CAAA,EACE,CAAA,CACF;;GAEL,kBAAC,GAAD;IACE,MAAM;IACN,cAAc;IACd,YAAW;IACX,IAAI,EAAS,MAAM;IACnB,SAAS;KACP,MAAM,EAAS;KACf,aAAa,EAAS,eAAe,KAAA;KACrC,eAAe,EAAS;KACxB,QAAQ,EAAS;KACjB,QAAQ,EAAS;IACnB;IACA,eAAe,EAAQ;GACxB,CAAA;EACD,EAAA,CAAA,IAjKF,kBAAC,GAAD;GACE,cAAa;GACb,OAAO,EAAE,kCAAkC,mBAAmB;GAC9D,aAAa,EACX,wCACA,wDACF;EACD,CAAA;CA4JM,CAAA;AAEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderPage.d.ts","sourceRoot":"","sources":["../../../src/ggnomad/pages/ProviderPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProviderPage.d.ts","sourceRoot":"","sources":["../../../src/ggnomad/pages/ProviderPage.tsx"],"names":[],"mappings":"AAaA,wBAAgB,YAAY,gCAuJ3B"}
|
|
@@ -1,96 +1,145 @@
|
|
|
1
1
|
import { GGNOMAD_PROVIDERS_QUERY as e } from "../graphql.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { formatDate as t } from "../utils/format.js";
|
|
3
|
+
import { PageShell as n } from "./PageShell.js";
|
|
4
|
+
import { StatusBadge as r } from "../components/StatusBadge.js";
|
|
5
|
+
import { EntityCard as i } from "../components/EntityCard.js";
|
|
6
|
+
import { LoadMoreButton as a } from "../components/LoadMoreButton.js";
|
|
7
|
+
import { RatingSummary as o } from "../components/RatingSummary.js";
|
|
6
8
|
import "../components/index.js";
|
|
7
|
-
import { useState as
|
|
8
|
-
import { Briefcase as
|
|
9
|
-
import { useI18n as
|
|
10
|
-
import { Link as
|
|
11
|
-
import { useQuery as
|
|
12
|
-
import { GlassCard as
|
|
13
|
-
import { jsx as
|
|
9
|
+
import { useState as s } from "react";
|
|
10
|
+
import { Briefcase as c, CalendarPlus as l, Globe as u, Mail as d, Phone as f, Store as p } from "lucide-react";
|
|
11
|
+
import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
|
+
import { Link as h } from "react-router";
|
|
13
|
+
import { useQuery as g } from "@apollo/client/react";
|
|
14
|
+
import { GlassCard as _, IllustratedEmptyState as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
|
|
15
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
16
|
//#region src/ggnomad/pages/ProviderPage.tsx
|
|
15
|
-
function
|
|
16
|
-
let { t:
|
|
17
|
-
limit:
|
|
17
|
+
function S() {
|
|
18
|
+
let { t: S } = m(), [C, w] = s(12), { data: T } = g(e, { variables: {
|
|
19
|
+
limit: C,
|
|
18
20
|
offset: 0
|
|
19
|
-
} }),
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
title:
|
|
22
|
-
titleAccent:
|
|
23
|
-
subtitle:
|
|
24
|
-
children: [/* @__PURE__ */
|
|
25
|
-
icon: /* @__PURE__ */
|
|
26
|
-
children:
|
|
27
|
-
}),
|
|
21
|
+
} }), E = T?.ggnomadProviders ?? [];
|
|
22
|
+
return /* @__PURE__ */ x(n, {
|
|
23
|
+
title: S("ggnomad.provider.title", "Provider Dashboard"),
|
|
24
|
+
titleAccent: S("ggnomad.provider.title.accent", "Provider"),
|
|
25
|
+
subtitle: S("ggnomad.provider.subtitle", "B2B provider operations and onboarding metrics"),
|
|
26
|
+
children: [/* @__PURE__ */ b(y, {
|
|
27
|
+
icon: /* @__PURE__ */ b(c, { className: "size-4" }),
|
|
28
|
+
children: S("ggnomad.provider.purpose", "Track the supply side of the marketplace — the hotels, tour operators and venues that publish inventory. Use it to monitor each provider’s status, listing count, revenue and rating, and to spot who needs onboarding attention.")
|
|
29
|
+
}), E.length === 0 ? /* @__PURE__ */ b(v, {
|
|
28
30
|
illustration: "empty-people",
|
|
29
|
-
title:
|
|
30
|
-
description:
|
|
31
|
-
}) : /* @__PURE__ */
|
|
31
|
+
title: S("ggnomad.provider.emptyTitle", "No providers onboarded"),
|
|
32
|
+
description: S("ggnomad.provider.emptyDescription", "Onboarded B2B providers and their performance will be tracked here.")
|
|
33
|
+
}) : /* @__PURE__ */ x(_, {
|
|
32
34
|
treatment: "glass",
|
|
33
35
|
glow: !0,
|
|
34
36
|
className: "border-border-seam p-5",
|
|
35
37
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ b("h2", {
|
|
37
39
|
className: "mb-4 text-lg font-medium tracking-tight text-text-primary",
|
|
38
|
-
children:
|
|
40
|
+
children: S("ggnomad.provider.onboardedProviders", "Onboarded providers")
|
|
39
41
|
}),
|
|
40
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ b("div", {
|
|
41
43
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
42
|
-
children:
|
|
44
|
+
children: E.map((e) => /* @__PURE__ */ b(i, {
|
|
43
45
|
title: e.name,
|
|
44
|
-
meta: e.type,
|
|
45
|
-
badge: /* @__PURE__ */
|
|
46
|
+
meta: e.description ?? e.type,
|
|
47
|
+
badge: /* @__PURE__ */ b(r, {
|
|
46
48
|
status: e.status,
|
|
47
49
|
live: e.status === "ACTIVE"
|
|
48
50
|
}),
|
|
49
|
-
footer: /* @__PURE__ */
|
|
50
|
-
className: "
|
|
51
|
+
footer: /* @__PURE__ */ x("div", {
|
|
52
|
+
className: "space-y-2 text-xs",
|
|
51
53
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
/* @__PURE__ */ b(o, {
|
|
55
|
+
rating: e.rating,
|
|
56
|
+
reviewCount: e.reviewCount
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ x("dl", {
|
|
59
|
+
className: "grid grid-cols-3 gap-2",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
62
|
+
className: "text-text-secondary",
|
|
63
|
+
children: S("ggnomad.provider.listings", "Listings")
|
|
64
|
+
}), /* @__PURE__ */ b("dd", {
|
|
65
|
+
className: "mt-0.5 font-medium tabular-nums text-text-primary",
|
|
66
|
+
children: e.listingCount
|
|
67
|
+
})] }),
|
|
68
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
69
|
+
className: "text-text-secondary",
|
|
70
|
+
children: S("ggnomad.provider.revenue", "Revenue")
|
|
71
|
+
}), /* @__PURE__ */ x("dd", {
|
|
72
|
+
className: "mt-0.5 font-medium tabular-nums text-text-primary",
|
|
73
|
+
children: ["$", Number(e.totalRevenue).toLocaleString()]
|
|
74
|
+
})] }),
|
|
75
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
76
|
+
className: "text-text-secondary",
|
|
77
|
+
children: S("ggnomad.provider.type", "Type")
|
|
78
|
+
}), /* @__PURE__ */ b("dd", {
|
|
79
|
+
className: "mt-0.5 font-medium text-text-primary",
|
|
80
|
+
children: e.type
|
|
81
|
+
})] })
|
|
82
|
+
]
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ x("p", {
|
|
85
|
+
className: "inline-flex items-center gap-1 text-text-secondary",
|
|
86
|
+
children: [/* @__PURE__ */ b(l, {
|
|
87
|
+
className: "size-3.5",
|
|
88
|
+
"aria-hidden": "true"
|
|
89
|
+
}), S("ggnomad.provider.joined", "Joined {{date}}").replace("{{date}}", t(e.createdAt) ?? "—")]
|
|
90
|
+
}),
|
|
91
|
+
e.contactEmail || e.contactPhone || e.website ? /* @__PURE__ */ x("div", {
|
|
92
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
93
|
+
children: [
|
|
94
|
+
e.contactEmail ? /* @__PURE__ */ x("a", {
|
|
95
|
+
href: `mailto:${e.contactEmail}`,
|
|
96
|
+
className: "inline-flex items-center gap-1 text-action-primary-bg hover:underline",
|
|
97
|
+
children: [/* @__PURE__ */ b(d, {
|
|
98
|
+
className: "size-3.5",
|
|
99
|
+
"aria-hidden": "true"
|
|
100
|
+
}), e.contactEmail]
|
|
101
|
+
}) : null,
|
|
102
|
+
e.contactPhone ? /* @__PURE__ */ x("a", {
|
|
103
|
+
href: `tel:${e.contactPhone}`,
|
|
104
|
+
className: "inline-flex items-center gap-1 text-action-primary-bg hover:underline",
|
|
105
|
+
children: [/* @__PURE__ */ b(f, {
|
|
106
|
+
className: "size-3.5",
|
|
107
|
+
"aria-hidden": "true"
|
|
108
|
+
}), e.contactPhone]
|
|
109
|
+
}) : null,
|
|
110
|
+
e.website ? /* @__PURE__ */ x("a", {
|
|
111
|
+
href: e.website,
|
|
112
|
+
target: "_blank",
|
|
113
|
+
rel: "noreferrer noopener",
|
|
114
|
+
className: "inline-flex items-center gap-1 text-action-primary-bg hover:underline",
|
|
115
|
+
children: [/* @__PURE__ */ b(u, {
|
|
116
|
+
className: "size-3.5",
|
|
117
|
+
"aria-hidden": "true"
|
|
118
|
+
}), S("ggnomad.provider.website", "Website")]
|
|
119
|
+
}) : null
|
|
120
|
+
]
|
|
121
|
+
}) : null,
|
|
122
|
+
/* @__PURE__ */ b("div", {
|
|
123
|
+
className: "mt-1 border-t border-border-seam pt-2",
|
|
124
|
+
children: /* @__PURE__ */ x(h, {
|
|
76
125
|
to: `${e.id}/storefront`,
|
|
77
126
|
className: "inline-flex items-center gap-1 text-xs font-medium text-action-primary-bg hover:underline",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ b(p, { className: "size-3.5" }), S("ggnomad.provider.manageStorefront", "Manage storefront")]
|
|
79
128
|
})
|
|
80
129
|
})
|
|
81
130
|
]
|
|
82
131
|
})
|
|
83
132
|
}, e.id))
|
|
84
133
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
visible:
|
|
87
|
-
onLoadMore: () =>
|
|
134
|
+
/* @__PURE__ */ b(a, {
|
|
135
|
+
visible: E.length >= C,
|
|
136
|
+
onLoadMore: () => w((e) => e + 12)
|
|
88
137
|
})
|
|
89
138
|
]
|
|
90
139
|
})]
|
|
91
140
|
});
|
|
92
141
|
}
|
|
93
142
|
//#endregion
|
|
94
|
-
export {
|
|
143
|
+
export { S as ProviderPage };
|
|
95
144
|
|
|
96
145
|
//# sourceMappingURL=ProviderPage.js.map
|