@burdenoff/microfe-ggnomad 2026.624.1 → 2026.704.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/DetailRow.js +18 -0
- package/dist/ggnomad/components/DetailRow.js.map +1 -0
- package/dist/ggnomad/components/EntityCard.js +50 -0
- package/dist/ggnomad/components/EntityCard.js.map +1 -0
- package/dist/ggnomad/components/SectionCard.js +21 -0
- package/dist/ggnomad/components/SectionCard.js.map +1 -0
- package/dist/ggnomad/components/StatCard.js +27 -0
- package/dist/ggnomad/components/StatCard.js.map +1 -0
- package/dist/ggnomad/components/StatusBadge.js +65 -0
- package/dist/ggnomad/components/StatusBadge.js.map +1 -0
- package/dist/ggnomad/components/index.js +5 -0
- package/dist/ggnomad/graphql.js +61 -17
- package/dist/ggnomad/graphql.js.map +1 -1
- package/dist/ggnomad/pages/ActivityDetailsPage.js +84 -37
- package/dist/ggnomad/pages/ActivityDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/AnalyticsPage.js +111 -55
- package/dist/ggnomad/pages/AnalyticsPage.js.map +1 -1
- package/dist/ggnomad/pages/BookingsPage.js +183 -61
- package/dist/ggnomad/pages/BookingsPage.js.map +1 -1
- package/dist/ggnomad/pages/DashboardPage.js +132 -107
- package/dist/ggnomad/pages/DashboardPage.js.map +1 -1
- package/dist/ggnomad/pages/EntertainmentPage.js +40 -33
- package/dist/ggnomad/pages/EntertainmentPage.js.map +1 -1
- package/dist/ggnomad/pages/EventDetailsPage.js +86 -39
- package/dist/ggnomad/pages/EventDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/FavoritesPage.js +110 -33
- package/dist/ggnomad/pages/FavoritesPage.js.map +1 -1
- package/dist/ggnomad/pages/HospitalityPage.js +45 -42
- package/dist/ggnomad/pages/HospitalityPage.js.map +1 -1
- package/dist/ggnomad/pages/PageShell.js +33 -11
- package/dist/ggnomad/pages/PageShell.js.map +1 -1
- package/dist/ggnomad/pages/PropertyDetailsPage.js +95 -45
- package/dist/ggnomad/pages/PropertyDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/ProviderPage.js +65 -29
- package/dist/ggnomad/pages/ProviderPage.js.map +1 -1
- package/dist/ggnomad/pages/SearchPage.js +57 -48
- package/dist/ggnomad/pages/SearchPage.js.map +1 -1
- package/dist/ggnomad/pages/TourDetailsPage.js +86 -39
- package/dist/ggnomad/pages/TourDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/TourismPage.js +64 -63
- package/dist/ggnomad/pages/TourismPage.js.map +1 -1
- package/dist/ggnomad/pages/TravelPage.js +43 -27
- package/dist/ggnomad/pages/TravelPage.js.map +1 -1
- package/dist/ggnomad/utils/cn.js +10 -0
- package/dist/ggnomad/utils/cn.js.map +1 -0
- package/dist/ggnomad/utils/notify.js +36 -0
- package/dist/ggnomad/utils/notify.js.map +1 -0
- package/package.json +3 -2
|
@@ -1,40 +1,117 @@
|
|
|
1
|
-
import { GGNOMAD_FAVORITES_QUERY as e,
|
|
2
|
-
import { PageShell as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { GGNOMAD_FAVORITES_QUERY as e, GGNOMAD_FAVORITE_TARGETS_QUERY as t, TOGGLE_GGNOMAD_FAVORITE_MUTATION as n } from "../graphql.js";
|
|
2
|
+
import { PageShell as r } from "./PageShell.js";
|
|
3
|
+
import { EntityCard as i } from "../components/EntityCard.js";
|
|
4
|
+
import "../components/index.js";
|
|
5
|
+
import { notify as a } from "../utils/notify.js";
|
|
6
|
+
import { useMemo as o } from "react";
|
|
7
|
+
import { Heart as s } from "lucide-react";
|
|
8
|
+
import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
+
import { useMutation as l, useQuery as u } from "@apollo/client/react";
|
|
10
|
+
import { CTAOverflowMenu as d, GlassCard as f, IllustratedEmptyState as p, PagePurpose as m } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
12
|
//#region src/ggnomad/pages/FavoritesPage.tsx
|
|
6
|
-
function
|
|
7
|
-
let {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
function _() {
|
|
14
|
+
let { t: _ } = c(), v = (e) => {
|
|
15
|
+
switch (e.toUpperCase()) {
|
|
16
|
+
case "PROPERTY": return _("ggnomad.favorites.type.property", "Property");
|
|
17
|
+
case "TOUR": return _("ggnomad.favorites.type.tour", "Tour");
|
|
18
|
+
case "EVENT": return _("ggnomad.favorites.type.event", "Event");
|
|
19
|
+
case "ACTIVITY": return _("ggnomad.favorites.type.activity", "Activity");
|
|
20
|
+
case "TRIP": return _("ggnomad.favorites.type.trip", "Trip");
|
|
21
|
+
default: return _("ggnomad.favorites.type.saved", "Saved item");
|
|
22
|
+
}
|
|
23
|
+
}, { data: y, refetch: b } = u(e), { data: x } = u(t), [S] = l(n), C = o(() => {
|
|
24
|
+
let e = /* @__PURE__ */ new Map();
|
|
25
|
+
for (let t of [
|
|
26
|
+
...x?.ggnomadProperties ?? [],
|
|
27
|
+
...x?.ggnomadTours ?? [],
|
|
28
|
+
...x?.ggnomadEvents ?? [],
|
|
29
|
+
...x?.ggnomadActivities ?? []
|
|
30
|
+
]) e.set(t.id, t.name);
|
|
31
|
+
return e;
|
|
32
|
+
}, [x]), w = y?.ggnomadFavorites ?? [], T = () => {
|
|
33
|
+
let e = x?.ggnomadProperties?.[0];
|
|
34
|
+
if (e) return {
|
|
35
|
+
type: "PROPERTY",
|
|
36
|
+
listing: e
|
|
37
|
+
};
|
|
38
|
+
let t = x?.ggnomadTours?.[0];
|
|
39
|
+
if (t) return {
|
|
40
|
+
type: "TOUR",
|
|
41
|
+
listing: t
|
|
42
|
+
};
|
|
43
|
+
let n = x?.ggnomadEvents?.[0];
|
|
44
|
+
if (n) return {
|
|
45
|
+
type: "EVENT",
|
|
46
|
+
listing: n
|
|
47
|
+
};
|
|
48
|
+
let r = x?.ggnomadActivities?.[0];
|
|
49
|
+
return r ? {
|
|
50
|
+
type: "ACTIVITY",
|
|
51
|
+
listing: r
|
|
52
|
+
} : null;
|
|
53
|
+
}, E = async () => {
|
|
54
|
+
let e = T();
|
|
55
|
+
if (!e) {
|
|
56
|
+
a.warning(_("ggnomad.favorites.toast.noListingsTitle", "Nothing to favorite yet"), _("ggnomad.favorites.toast.noListingsBody", "Add a property, tour, event or activity first, then save it to your favorites."));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
let { type: t, listing: n } = e;
|
|
60
|
+
try {
|
|
61
|
+
let e = await S({ variables: { input: {
|
|
62
|
+
targetType: t,
|
|
63
|
+
targetId: n.id
|
|
64
|
+
} } });
|
|
65
|
+
if (e.error) {
|
|
66
|
+
a.error(_("ggnomad.favorites.toast.errorTitle", "Could not update favorite"), e.error.message);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
let r = e.data?.toggleGgnomadFavorite === !0;
|
|
70
|
+
a.success(r ? _("ggnomad.favorites.toast.added", "Added to favorites") : _("ggnomad.favorites.toast.removed", "Removed from favorites"), n.name), await b();
|
|
71
|
+
} catch (e) {
|
|
72
|
+
a.error(_("ggnomad.favorites.toast.errorTitle", "Could not update favorite"), e instanceof Error ? e.message : String(e));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
return /* @__PURE__ */ g(r, {
|
|
76
|
+
title: _("ggnomad.favorites.title", "Favorites"),
|
|
77
|
+
titleAccent: _("ggnomad.favorites.title.accent", "Favorites"),
|
|
78
|
+
subtitle: _("ggnomad.favorites.subtitle", "Social ecosystem: saved entities across GGNomad domains"),
|
|
79
|
+
actions: /* @__PURE__ */ h(d, {
|
|
80
|
+
primary: {
|
|
81
|
+
label: _("ggnomad.favorites.actions.toggleDemo", "Toggle demo favorite"),
|
|
82
|
+
onSelect: () => void E(),
|
|
83
|
+
icon: /* @__PURE__ */ h(s, {})
|
|
84
|
+
},
|
|
85
|
+
actions: []
|
|
86
|
+
}),
|
|
87
|
+
children: [/* @__PURE__ */ h(m, {
|
|
88
|
+
icon: /* @__PURE__ */ h(s, { className: "size-4" }),
|
|
89
|
+
children: _("ggnomad.favorites.purpose", "A personal shortlist that spans every GGNomad domain — save properties, tours, events and trips you’re considering so you can compare and come back to them before you book.")
|
|
90
|
+
}), w.length === 0 ? /* @__PURE__ */ h(p, {
|
|
91
|
+
illustration: "empty-notifications",
|
|
92
|
+
title: _("ggnomad.favorites.emptyTitle", "No favorites saved"),
|
|
93
|
+
description: _("ggnomad.favorites.emptyDescription", "Items you save across travel, hospitality and tourism will collect here.")
|
|
94
|
+
}) : /* @__PURE__ */ g(f, {
|
|
95
|
+
treatment: "glass",
|
|
96
|
+
glow: !0,
|
|
97
|
+
className: "border-border-seam p-5",
|
|
98
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
99
|
+
className: "mb-4 text-lg font-medium tracking-tight text-text-primary",
|
|
100
|
+
children: _("ggnomad.favorites.savedItems", "Saved items")
|
|
101
|
+
}), /* @__PURE__ */ h("div", {
|
|
102
|
+
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
103
|
+
children: w.map((e) => {
|
|
104
|
+
let t = C.get(e.targetId);
|
|
105
|
+
return /* @__PURE__ */ h(i, {
|
|
106
|
+
title: t ?? v(e.targetType),
|
|
107
|
+
meta: t ? v(e.targetType) : _("ggnomad.favorites.savedListing", "Saved listing")
|
|
108
|
+
}, e.id);
|
|
109
|
+
})
|
|
110
|
+
})]
|
|
34
111
|
})]
|
|
35
112
|
});
|
|
36
113
|
}
|
|
37
114
|
//#endregion
|
|
38
|
-
export {
|
|
115
|
+
export { _ as FavoritesPage };
|
|
39
116
|
|
|
40
117
|
//# sourceMappingURL=FavoritesPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoritesPage.js","names":[],"sources":["../../../src/ggnomad/pages/FavoritesPage.tsx"],"sourcesContent":["import { useMutation, useQuery } from '@apollo/client/react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"FavoritesPage.js","names":[],"sources":["../../../src/ggnomad/pages/FavoritesPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport type { TypedDocumentNode } from '@apollo/client';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Heart } from 'lucide-react';\nimport {\n CTAOverflowMenu,\n GlassCard,\n IllustratedEmptyState,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\n\nimport {\n GGNOMAD_FAVORITES_QUERY,\n GGNOMAD_FAVORITE_TARGETS_QUERY,\n TOGGLE_GGNOMAD_FAVORITE_MUTATION,\n} from '../graphql';\nimport { PageShell } from './PageShell';\nimport { EntityCard } from '../components';\nimport { notify } from '../utils/notify';\n\ntype FavoriteType = 'PROPERTY' | 'TOUR' | 'EVENT' | 'ACTIVITY';\n\ntype Listing = { id: string; name: string };\n\nexport function FavoritesPage() {\n const { t } = useI18n();\n\n const typeLabel = (type: string): string => {\n switch (type.toUpperCase()) {\n case 'PROPERTY':\n return t('ggnomad.favorites.type.property', 'Property');\n case 'TOUR':\n return t('ggnomad.favorites.type.tour', 'Tour');\n case 'EVENT':\n return t('ggnomad.favorites.type.event', 'Event');\n case 'ACTIVITY':\n return t('ggnomad.favorites.type.activity', 'Activity');\n case 'TRIP':\n return t('ggnomad.favorites.type.trip', 'Trip');\n default:\n return t('ggnomad.favorites.type.saved', 'Saved item');\n }\n };\n\n const { data, refetch } = useQuery(\n GGNOMAD_FAVORITES_QUERY as TypedDocumentNode<\n { ggnomadFavorites: Array<{ id: string; targetType: string; targetId: string }> },\n Record<string, never>\n >\n );\n\n // Real listing names so a saved favorite reads as its entity name instead of\n // a raw enum + UUID (the backend only stores targetType + targetId).\n const { data: targetsData } = useQuery(\n GGNOMAD_FAVORITE_TARGETS_QUERY as TypedDocumentNode<\n {\n ggnomadProperties: Listing[];\n ggnomadTours: Listing[];\n ggnomadEvents: Listing[];\n ggnomadActivities: Listing[];\n },\n Record<string, never>\n >\n );\n\n const [toggleFavorite] = useMutation(\n TOGGLE_GGNOMAD_FAVORITE_MUTATION as TypedDocumentNode<\n { toggleGgnomadFavorite: boolean },\n { input: { targetType: FavoriteType; targetId: string } }\n >\n );\n\n const nameById = useMemo(() => {\n const map = new Map<string, string>();\n for (const listing of [\n ...(targetsData?.ggnomadProperties ?? []),\n ...(targetsData?.ggnomadTours ?? []),\n ...(targetsData?.ggnomadEvents ?? []),\n ...(targetsData?.ggnomadActivities ?? []),\n ]) {\n map.set(listing.id, listing.name);\n }\n return map;\n }, [targetsData]);\n\n const favorites = (data?.ggnomadFavorites ?? []) as Array<{\n id: string;\n targetType: string;\n targetId: string;\n }>;\n\n /** First available real listing, in priority order, mapped to a favorite type. */\n const resolveDemoTarget = (): { type: FavoriteType; listing: Listing } | null => {\n const property = targetsData?.ggnomadProperties?.[0];\n if (property) return { type: 'PROPERTY', listing: property };\n const tour = targetsData?.ggnomadTours?.[0];\n if (tour) return { type: 'TOUR', listing: tour };\n const event = targetsData?.ggnomadEvents?.[0];\n if (event) return { type: 'EVENT', listing: event };\n const activity = targetsData?.ggnomadActivities?.[0];\n if (activity) return { type: 'ACTIVITY', listing: activity };\n return null;\n };\n\n const handleToggleDemo = async () => {\n const target = resolveDemoTarget();\n if (!target) {\n notify.warning(\n t('ggnomad.favorites.toast.noListingsTitle', 'Nothing to favorite yet'),\n t(\n 'ggnomad.favorites.toast.noListingsBody',\n 'Add a property, tour, event or activity first, then save it to your favorites.'\n )\n );\n return;\n }\n const { type, listing } = target;\n try {\n const result = await toggleFavorite({\n variables: { input: { targetType: type, targetId: listing.id } },\n });\n if (result.error) {\n notify.error(\n t('ggnomad.favorites.toast.errorTitle', 'Could not update favorite'),\n result.error.message\n );\n return;\n }\n const added = result.data?.toggleGgnomadFavorite === true;\n notify.success(\n added\n ? t('ggnomad.favorites.toast.added', 'Added to favorites')\n : t('ggnomad.favorites.toast.removed', 'Removed from favorites'),\n listing.name\n );\n await refetch();\n } catch (err) {\n notify.error(\n t('ggnomad.favorites.toast.errorTitle', 'Could not update favorite'),\n err instanceof Error ? err.message : String(err)\n );\n }\n };\n\n return (\n <PageShell\n title={t('ggnomad.favorites.title', 'Favorites')}\n titleAccent={t('ggnomad.favorites.title.accent', 'Favorites')}\n subtitle={t(\n 'ggnomad.favorites.subtitle',\n 'Social ecosystem: saved entities across GGNomad domains'\n )}\n actions={\n <CTAOverflowMenu\n primary={{\n label: t('ggnomad.favorites.actions.toggleDemo', 'Toggle demo favorite'),\n onSelect: () => void handleToggleDemo(),\n icon: <Heart />,\n }}\n actions={[]}\n />\n }\n >\n <PagePurpose icon={<Heart className=\"size-4\" />}>\n {t(\n 'ggnomad.favorites.purpose',\n 'A personal shortlist that spans every GGNomad domain — save properties, tours, events and trips you’re considering so you can compare and come back to them before you book.'\n )}\n </PagePurpose>\n\n {favorites.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-notifications\"\n title={t('ggnomad.favorites.emptyTitle', 'No favorites saved')}\n description={t(\n 'ggnomad.favorites.emptyDescription',\n 'Items you save across travel, hospitality and tourism will collect here.'\n )}\n />\n ) : (\n <GlassCard treatment=\"glass\" glow className=\"border-border-seam p-5\">\n <h2 className=\"mb-4 text-lg font-medium tracking-tight text-text-primary\">\n {t('ggnomad.favorites.savedItems', 'Saved items')}\n </h2>\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {favorites.map((favorite) => {\n const resolvedName = nameById.get(favorite.targetId);\n return (\n <EntityCard\n key={favorite.id}\n title={resolvedName ?? typeLabel(favorite.targetType)}\n meta={\n resolvedName\n ? typeLabel(favorite.targetType)\n : t('ggnomad.favorites.savedListing', 'Saved listing')\n }\n />\n );\n })}\n </div>\n </GlassCard>\n )}\n </PageShell>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAyBA,SAAgB,IAAgB;CAC9B,IAAM,EAAE,SAAM,GAAS,EAEjB,KAAa,MAAyB;AAC1C,UAAQ,EAAK,aAAa,EAA1B;GACE,KAAK,WACH,QAAO,EAAE,mCAAmC,WAAW;GACzD,KAAK,OACH,QAAO,EAAE,+BAA+B,OAAO;GACjD,KAAK,QACH,QAAO,EAAE,gCAAgC,QAAQ;GACnD,KAAK,WACH,QAAO,EAAE,mCAAmC,WAAW;GACzD,KAAK,OACH,QAAO,EAAE,+BAA+B,OAAO;GACjD,QACE,QAAO,EAAE,gCAAgC,aAAa;;IAItD,EAAE,SAAM,eAAY,EACxB,EAID,EAIK,EAAE,MAAM,MAAgB,EAC5B,EASD,EAEK,CAAC,KAAkB,EACvB,EAID,EAEK,IAAW,QAAc;EAC7B,IAAM,oBAAM,IAAI,KAAqB;AACrC,OAAK,IAAM,KAAW;GACpB,GAAI,GAAa,qBAAqB,EAAE;GACxC,GAAI,GAAa,gBAAgB,EAAE;GACnC,GAAI,GAAa,iBAAiB,EAAE;GACpC,GAAI,GAAa,qBAAqB,EAAE;GACzC,CACC,GAAI,IAAI,EAAQ,IAAI,EAAQ,KAAK;AAEnC,SAAO;IACN,CAAC,EAAY,CAAC,EAEX,IAAa,GAAM,oBAAoB,EAAE,EAOzC,UAA2E;EAC/E,IAAM,IAAW,GAAa,oBAAoB;AAClD,MAAI,EAAU,QAAO;GAAE,MAAM;GAAY,SAAS;GAAU;EAC5D,IAAM,IAAO,GAAa,eAAe;AACzC,MAAI,EAAM,QAAO;GAAE,MAAM;GAAQ,SAAS;GAAM;EAChD,IAAM,IAAQ,GAAa,gBAAgB;AAC3C,MAAI,EAAO,QAAO;GAAE,MAAM;G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a,EACX,sCACA,2EACD;GACD,CAAA,GAEF,kBAAC,GAAD;GAAW,WAAU;GAAQ,MAAA;GAAK,WAAU;aAA5C,CACE,kBAAC,MAAD;IAAI,WAAU;cACX,EAAE,gCAAgC,cAAc;IAC9C,CAAA,EACL,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAU,KAAK,MAAa;KAC3B,IAAM,IAAe,EAAS,IAAI,EAAS,SAAS;AACpD,YACE,kBAAC,GAAD;MAEE,OAAO,KAAgB,EAAU,EAAS,WAAW;MACrD,MACE,IACI,EAAU,EAAS,WAAW,GAC9B,EAAE,kCAAkC,gBAAgB;MAE1D,EAPK,EAAS,GAOd;MAEJ;IACE,CAAA,CACI;KAEJ"}
|
|
@@ -1,53 +1,56 @@
|
|
|
1
1
|
import { GGNOMAD_PROPERTIES_QUERY as e } from "../graphql.js";
|
|
2
2
|
import { PageShell as t } from "./PageShell.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { EntityCard as n } from "../components/EntityCard.js";
|
|
4
|
+
import "../components/index.js";
|
|
5
|
+
import { Hotel as r, Star as i } from "lucide-react";
|
|
6
|
+
import { useI18n as a } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
7
|
+
import { useQuery as o } from "@apollo/client/react";
|
|
8
|
+
import { GlassCard as s, IllustratedEmptyState as c, PagePurpose as l } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
10
|
//#region src/ggnomad/pages/HospitalityPage.tsx
|
|
8
|
-
function
|
|
9
|
-
let { t:
|
|
11
|
+
function f() {
|
|
12
|
+
let { t: f } = a(), { data: p } = o(e, { variables: {
|
|
10
13
|
first: 20,
|
|
11
14
|
skip: 0
|
|
12
|
-
} }),
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
title:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
]
|
|
15
|
+
} }), m = p?.ggnomadProperties ?? [];
|
|
16
|
+
return /* @__PURE__ */ d(t, {
|
|
17
|
+
title: f("ggnomad.hospitality.title", "Hospitality"),
|
|
18
|
+
titleAccent: f("ggnomad.hospitality.title.accent", "Hospitality"),
|
|
19
|
+
subtitle: f("ggnomad.hospitality.subtitle", "Property discovery powered by live GraphQL data"),
|
|
20
|
+
children: [/* @__PURE__ */ u(l, {
|
|
21
|
+
icon: /* @__PURE__ */ u(r, { className: "size-4" }),
|
|
22
|
+
children: f("ggnomad.hospitality.purpose", "Discover places to stay — hotels, homestays and short-stay rentals. Open any property to review its nightly price, guest capacity and rating, then create a booking for the dates you need.")
|
|
23
|
+
}), m.length === 0 ? /* @__PURE__ */ u(c, {
|
|
24
|
+
illustration: "empty-data",
|
|
25
|
+
title: f("ggnomad.hospitality.emptyTitle", "No properties available"),
|
|
26
|
+
description: f("ggnomad.hospitality.emptyDescription", "Properties published by providers will be discoverable here.")
|
|
27
|
+
}) : /* @__PURE__ */ d(s, {
|
|
28
|
+
treatment: "glass",
|
|
29
|
+
glow: !0,
|
|
30
|
+
className: "border-border-seam p-5",
|
|
31
|
+
children: [/* @__PURE__ */ u("h2", {
|
|
32
|
+
className: "mb-4 text-lg font-medium tracking-tight text-text-primary",
|
|
33
|
+
children: f("ggnomad.hospitality.featuredStays", "Featured stays")
|
|
34
|
+
}), /* @__PURE__ */ u("div", {
|
|
35
|
+
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
36
|
+
children: m.map((e) => /* @__PURE__ */ u(n, {
|
|
37
|
+
to: e.id,
|
|
38
|
+
title: e.name,
|
|
39
|
+
meta: e.type,
|
|
40
|
+
price: `${e.currency} ${Number(e.pricePerNight).toFixed(2)} ${f("ggnomad.hospitality.card.perNight", "per night")}`,
|
|
41
|
+
footer: /* @__PURE__ */ d("span", {
|
|
42
|
+
className: "inline-flex items-center gap-1 tabular-nums",
|
|
43
|
+
children: [/* @__PURE__ */ u(i, {
|
|
44
|
+
className: "size-3.5 text-status-warning-text",
|
|
45
|
+
"aria-hidden": "true"
|
|
46
|
+
}), e.rating ?? f("ggnomad.hospitality.card.noRating", "N/A")]
|
|
44
47
|
})
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
+
}, e.id))
|
|
49
|
+
})]
|
|
50
|
+
})]
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
53
|
//#endregion
|
|
51
|
-
export {
|
|
54
|
+
export { f as HospitalityPage };
|
|
52
55
|
|
|
53
56
|
//# sourceMappingURL=HospitalityPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HospitalityPage.js","names":[],"sources":["../../../src/ggnomad/pages/HospitalityPage.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport {
|
|
1
|
+
{"version":3,"file":"HospitalityPage.js","names":[],"sources":["../../../src/ggnomad/pages/HospitalityPage.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client/react';\nimport type { TypedDocumentNode } from '@apollo/client';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { Hotel, Star } from 'lucide-react';\nimport { GlassCard, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nimport { GGNOMAD_PROPERTIES_QUERY } from '../graphql';\nimport { PageShell } from './PageShell';\nimport { EntityCard } from '../components';\n\nexport function HospitalityPage() {\n const { t } = useI18n();\n const { data } = useQuery(\n GGNOMAD_PROPERTIES_QUERY as TypedDocumentNode<\n {\n ggnomadProperties: Array<{\n id: string;\n name: string;\n type: string;\n pricePerNight: number;\n currency: string;\n rating?: number;\n }>;\n },\n { first: number; skip: number }\n >,\n { variables: { first: 20, skip: 0 } }\n );\n const properties = data?.ggnomadProperties ?? [];\n\n return (\n <PageShell\n title={t('ggnomad.hospitality.title', 'Hospitality')}\n titleAccent={t('ggnomad.hospitality.title.accent', 'Hospitality')}\n subtitle={t(\n 'ggnomad.hospitality.subtitle',\n 'Property discovery powered by live GraphQL data'\n )}\n >\n <PagePurpose icon={<Hotel className=\"size-4\" />}>\n {t(\n 'ggnomad.hospitality.purpose',\n 'Discover places to stay — hotels, homestays and short-stay rentals. Open any property to review its nightly price, guest capacity and rating, then create a booking for the dates you need.'\n )}\n </PagePurpose>\n\n {properties.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={t('ggnomad.hospitality.emptyTitle', 'No properties available')}\n description={t(\n 'ggnomad.hospitality.emptyDescription',\n 'Properties published by providers will be discoverable here.'\n )}\n />\n ) : (\n <GlassCard treatment=\"glass\" glow className=\"border-border-seam p-5\">\n <h2 className=\"mb-4 text-lg font-medium tracking-tight text-text-primary\">\n {t('ggnomad.hospitality.featuredStays', 'Featured stays')}\n </h2>\n <div className=\"grid gap-3 sm:grid-cols-2 xl:grid-cols-3\">\n {properties.map((property) => (\n <EntityCard\n key={property.id}\n to={property.id}\n title={property.name}\n meta={property.type}\n price={`${property.currency} ${Number(property.pricePerNight).toFixed(2)} ${t(\n 'ggnomad.hospitality.card.perNight',\n 'per night'\n )}`}\n footer={\n <span className=\"inline-flex items-center gap-1 tabular-nums\">\n <Star className=\"size-3.5 text-status-warning-text\" aria-hidden=\"true\" />\n {property.rating ?? t('ggnomad.hospitality.card.noRating', 'N/A')}\n </span>\n }\n />\n ))}\n </div>\n </GlassCard>\n )}\n </PageShell>\n );\n}\n"],"mappings":";;;;;;;;;;AAUA,SAAgB,IAAkB;CAChC,IAAM,EAAE,SAAM,GAAS,EACjB,EAAE,YAAS,EACf,GAaA,EAAE,WAAW;EAAE,OAAO;EAAI,MAAM;EAAG,EAAE,CACtC,EACK,IAAa,GAAM,qBAAqB,EAAE;AAEhD,QACE,kBAAC,GAAD;EACE,OAAO,EAAE,6BAA6B,cAAc;EACpD,aAAa,EAAE,oCAAoC,cAAc;EACjE,UAAU,EACR,gCACA,kDACD;YANH,CAQE,kBAAC,GAAD;GAAa,MAAM,kBAAC,GAAD,EAAO,WAAU,UAAW,CAAA;aAC5C,EACC,+BACA,8LACD;GACW,CAAA,EAEb,EAAW,WAAW,IACrB,kBAAC,GAAD;GACE,cAAa;GACb,OAAO,EAAE,kCAAkC,0BAA0B;GACrE,aAAa,EACX,wCACA,+DACD;GACD,CAAA,GAEF,kBAAC,GAAD;GAAW,WAAU;GAAQ,MAAA;GAAK,WAAU;aAA5C,CACE,kBAAC,MAAD;IAAI,WAAU;cACX,EAAE,qCAAqC,iBAAiB;IACtD,CAAA,EACL,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAW,KAAK,MACf,kBAAC,GAAD;KAEE,IAAI,EAAS;KACb,OAAO,EAAS;KAChB,MAAM,EAAS;KACf,OAAO,GAAG,EAAS,SAAS,GAAG,OAAO,EAAS,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG,EAC1E,qCACA,YACD;KACD,QACE,kBAAC,QAAD;MAAM,WAAU;gBAAhB,CACE,kBAAC,GAAD;OAAM,WAAU;OAAoC,eAAY;OAAS,CAAA,EACxE,EAAS,UAAU,EAAE,qCAAqC,MAAM,CAC5D;;KAET,EAdK,EAAS,GAcd,CACF;IACE,CAAA,CACI;KAEJ"}
|
|
@@ -1,18 +1,40 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AuroraBackground as e, GradientText as t } from "@burdenoff/fe-libs/ui";
|
|
2
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
3
|
//#region src/ggnomad/pages/PageShell.tsx
|
|
3
|
-
function
|
|
4
|
-
return /* @__PURE__ */
|
|
4
|
+
function a({ title: a, subtitle: o, titleAccent: s, actions: c, hero: l = !1, children: u }) {
|
|
5
|
+
return /* @__PURE__ */ i("div", {
|
|
5
6
|
className: "space-y-6 p-6",
|
|
6
|
-
children: [/* @__PURE__ */
|
|
7
|
-
className: "
|
|
8
|
-
children:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
children: [/* @__PURE__ */ i("header", {
|
|
8
|
+
className: l ? "relative overflow-hidden rounded-card border border-border-seam bg-gloss-card p-6 shadow-pop" : "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
9
|
+
children: [
|
|
10
|
+
l ? /* @__PURE__ */ r(e, { intensity: "subtle" }) : null,
|
|
11
|
+
/* @__PURE__ */ i("div", {
|
|
12
|
+
className: l ? "relative" : "min-w-0",
|
|
13
|
+
children: [/* @__PURE__ */ r("h1", {
|
|
14
|
+
className: "text-3xl font-semibold tracking-tight text-text-primary",
|
|
15
|
+
children: (() => {
|
|
16
|
+
if (!s || !a.includes(s)) return a;
|
|
17
|
+
let [e, o] = a.split(s);
|
|
18
|
+
return /* @__PURE__ */ i(n, { children: [
|
|
19
|
+
e,
|
|
20
|
+
/* @__PURE__ */ r(t, { children: s }),
|
|
21
|
+
o
|
|
22
|
+
] });
|
|
23
|
+
})()
|
|
24
|
+
}), /* @__PURE__ */ r("p", {
|
|
25
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
26
|
+
children: o
|
|
27
|
+
})]
|
|
28
|
+
}),
|
|
29
|
+
c ? /* @__PURE__ */ r("div", {
|
|
30
|
+
className: l ? "relative mt-4 sm:mt-0" : "flex-shrink-0",
|
|
31
|
+
children: c
|
|
32
|
+
}) : null
|
|
33
|
+
]
|
|
34
|
+
}), u]
|
|
13
35
|
});
|
|
14
36
|
}
|
|
15
37
|
//#endregion
|
|
16
|
-
export {
|
|
38
|
+
export { a as PageShell };
|
|
17
39
|
|
|
18
40
|
//# sourceMappingURL=PageShell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageShell.js","names":[],"sources":["../../../src/ggnomad/pages/PageShell.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react';\n\nexport function PageShell({\n title,\n subtitle,\n children,\n}:
|
|
1
|
+
{"version":3,"file":"PageShell.js","names":[],"sources":["../../../src/ggnomad/pages/PageShell.tsx"],"sourcesContent":["import type { PropsWithChildren, ReactNode } from 'react';\nimport { AuroraBackground, GradientText } from '@burdenoff/fe-libs/ui';\n\ntype PageShellProps = PropsWithChildren<{\n title: string;\n subtitle: string;\n /** Highlighted key noun rendered as a GradientText accent inside the H1. */\n titleAccent?: string;\n /** Single primary action / overflow menu cluster rendered at the header end. */\n actions?: ReactNode;\n /**\n * When true, the header becomes the MFE hero zone with a subtle aurora\n * backdrop. Use on exactly one page per MFE (the Dashboard).\n */\n hero?: boolean;\n}>;\n\n/**\n * Boff UI 2.0 page scaffold. The header is a seamless glass band; an optional\n * aurora backdrop turns it into the MFE hero. Content keeps its existing\n * vertical rhythm. The accent noun in the H1 is rendered via GradientText.\n */\nexport function PageShell({\n title,\n subtitle,\n titleAccent,\n actions,\n hero = false,\n children,\n}: PageShellProps) {\n const renderTitle = () => {\n if (!titleAccent || !title.includes(titleAccent)) {\n return title;\n }\n const [before, after] = title.split(titleAccent);\n return (\n <>\n {before}\n <GradientText>{titleAccent}</GradientText>\n {after}\n </>\n );\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <header\n className={\n hero\n ? 'relative overflow-hidden rounded-card border border-border-seam bg-gloss-card p-6 shadow-pop'\n : 'flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between'\n }\n >\n {hero ? <AuroraBackground intensity=\"subtle\" /> : null}\n <div className={hero ? 'relative' : 'min-w-0'}>\n <h1 className=\"text-3xl font-semibold tracking-tight text-text-primary\">\n {renderTitle()}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">{subtitle}</p>\n </div>\n {actions ? (\n <div className={hero ? 'relative mt-4 sm:mt-0' : 'flex-shrink-0'}>{actions}</div>\n ) : null}\n </header>\n {children}\n </div>\n );\n}\n"],"mappings":";;;AAsBA,SAAgB,EAAU,EACxB,UACA,aACA,gBACA,YACA,UAAO,IACP,eACiB;AAejB,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,UAAD;GACE,WACE,IACI,iGACA;aAJR;IAOG,IAAO,kBAAC,GAAD,EAAkB,WAAU,UAAW,CAAA,GAAG;IAClD,kBAAC,OAAD;KAAK,WAAW,IAAO,aAAa;eAApC,CACE,kBAAC,MAAD;MAAI,WAAU;uBAzBI;AACxB,WAAI,CAAC,KAAe,CAAC,EAAM,SAAS,EAAY,CAC9C,QAAO;OAET,IAAM,CAAC,GAAQ,KAAS,EAAM,MAAM,EAAY;AAChD,cACE,kBAAA,GAAA,EAAA,UAAA;QACG;QACD,kBAAC,GAAD,EAAA,UAAe,GAA2B,CAAA;QACzC;QACA,EAAA,CAAA;UAgBiB;MACX,CAAA,EACL,kBAAC,KAAD;MAAG,WAAU;gBAAoC;MAAa,CAAA,CAC1D;;IACL,IACC,kBAAC,OAAD;KAAK,WAAW,IAAO,0BAA0B;eAAkB;KAAc,CAAA,GAC/E;IACG;MACR,EACG"}
|
|
@@ -1,54 +1,104 @@
|
|
|
1
1
|
import { GGNOMAD_PROPERTY_QUERY as e } from "../graphql.js";
|
|
2
2
|
import { PageShell as t } from "./PageShell.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { SectionCard as n } from "../components/SectionCard.js";
|
|
4
|
+
import { DetailRow as r } from "../components/DetailRow.js";
|
|
5
|
+
import "../components/index.js";
|
|
6
|
+
import { CalendarCheck as i, Hotel as a } from "lucide-react";
|
|
7
|
+
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
+
import { useNavigate as s, useParams as c } from "react-router-dom";
|
|
9
|
+
import { useQuery as l } from "@apollo/client/react";
|
|
10
|
+
import { GlassCard as u, IllustratedEmptyState as d, NextSteps as f, PagePurpose as p } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
6
12
|
//#region src/ggnomad/pages/PropertyDetailsPage.tsx
|
|
7
|
-
function
|
|
8
|
-
let {
|
|
9
|
-
variables: { id:
|
|
10
|
-
skip: !
|
|
11
|
-
}),
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
title:
|
|
14
|
-
subtitle: "Detailed hospitality listing view",
|
|
15
|
-
children:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
13
|
+
function _() {
|
|
14
|
+
let { t: _ } = o(), v = s(), { id: y = "" } = c(), { data: b } = l(e, {
|
|
15
|
+
variables: { id: y },
|
|
16
|
+
skip: !y
|
|
17
|
+
}), x = b?.ggnomadProperty;
|
|
18
|
+
return /* @__PURE__ */ h(t, {
|
|
19
|
+
title: x?.name ?? _("ggnomad.property.fallbackTitle", "Property details"),
|
|
20
|
+
subtitle: _("ggnomad.property.subtitle", "Detailed hospitality listing view"),
|
|
21
|
+
children: x ? /* @__PURE__ */ g(m, { children: [
|
|
22
|
+
/* @__PURE__ */ h(p, {
|
|
23
|
+
icon: /* @__PURE__ */ h(a, { className: "size-4" }),
|
|
24
|
+
children: _("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.")
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ h(f, {
|
|
27
|
+
storageKey: "ggnomad-property-detail",
|
|
28
|
+
steps: [{
|
|
29
|
+
id: "book",
|
|
30
|
+
label: _("ggnomad.property.next.book", "Book this stay"),
|
|
31
|
+
description: _("ggnomad.property.next.bookDesc", "Reserve these dates and track it under Bookings."),
|
|
32
|
+
icon: /* @__PURE__ */ h(i, { className: "size-4" }),
|
|
33
|
+
onClick: () => v("../../bookings")
|
|
34
|
+
}, {
|
|
35
|
+
id: "browse",
|
|
36
|
+
label: _("ggnomad.property.next.browse", "Compare other stays"),
|
|
37
|
+
description: _("ggnomad.property.next.browseDesc", "Go back to hospitality listings to compare options."),
|
|
38
|
+
icon: /* @__PURE__ */ h(a, { className: "size-4" }),
|
|
39
|
+
onClick: () => v("..")
|
|
40
|
+
}]
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ g("div", {
|
|
43
|
+
className: "grid gap-4 lg:grid-cols-2",
|
|
44
|
+
children: [/* @__PURE__ */ g(n, {
|
|
45
|
+
title: _("ggnomad.property.about", "About"),
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ h("p", {
|
|
48
|
+
className: "text-sm text-text-secondary",
|
|
49
|
+
children: _("ggnomad.property.type", "Type")
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ h("p", {
|
|
52
|
+
className: "text-text-primary",
|
|
53
|
+
children: x.type
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ h("p", {
|
|
56
|
+
className: "mt-3 text-sm text-text-secondary",
|
|
57
|
+
children: _("ggnomad.property.description", "Description")
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ h("p", {
|
|
60
|
+
className: "text-text-primary",
|
|
61
|
+
children: x.description ?? _("ggnomad.property.noDescription", "No description")
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
}), /* @__PURE__ */ g(u, {
|
|
65
|
+
treatment: "glass",
|
|
66
|
+
glow: !0,
|
|
67
|
+
className: "border-border-seam p-5",
|
|
68
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
69
|
+
className: "mb-4 text-lg font-medium tracking-tight text-text-primary",
|
|
70
|
+
children: _("ggnomad.property.details", "Details")
|
|
71
|
+
}), /* @__PURE__ */ g("dl", {
|
|
72
|
+
className: "space-y-2 text-sm",
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ h(r, {
|
|
75
|
+
label: _("ggnomad.property.price", "Price"),
|
|
76
|
+
value: `${x.currency} ${Number(x.pricePerNight).toFixed(2)}`
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ h(r, {
|
|
79
|
+
label: _("ggnomad.property.guests", "Guests"),
|
|
80
|
+
value: String(x.maxGuests)
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ h(r, {
|
|
83
|
+
label: _("ggnomad.property.rating", "Rating"),
|
|
84
|
+
value: String(x.rating ?? _("ggnomad.property.noRating", "N/A"))
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ h(r, {
|
|
87
|
+
label: _("ggnomad.property.provider", "Provider"),
|
|
88
|
+
value: x.provider?.name ?? _("ggnomad.property.unassigned", "Unassigned")
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
})]
|
|
92
|
+
})]
|
|
93
|
+
})
|
|
94
|
+
] }) : /* @__PURE__ */ h(d, {
|
|
95
|
+
illustration: "empty-data",
|
|
96
|
+
title: _("ggnomad.property.notFoundTitle", "No property found"),
|
|
97
|
+
description: _("ggnomad.property.notFoundDescription", "This property is unavailable or may have been removed.")
|
|
48
98
|
})
|
|
49
99
|
});
|
|
50
100
|
}
|
|
51
101
|
//#endregion
|
|
52
|
-
export {
|
|
102
|
+
export { _ as PropertyDetailsPage };
|
|
53
103
|
|
|
54
104
|
//# sourceMappingURL=PropertyDetailsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyDetailsPage.js","names":[],"sources":["../../../src/ggnomad/pages/PropertyDetailsPage.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client/react';\nimport { useParams } from 'react-router-dom';\n\nimport { GGNOMAD_PROPERTY_QUERY } from '../graphql';\nimport { PageShell } from './PageShell';\n\nexport function PropertyDetailsPage() {\n const { id = '' } = useParams();\n const { data } = useQuery
|
|
1
|
+
{"version":3,"file":"PropertyDetailsPage.js","names":[],"sources":["../../../src/ggnomad/pages/PropertyDetailsPage.tsx"],"sourcesContent":["import { 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-dom';\nimport { CalendarCheck, Hotel } from 'lucide-react';\nimport { GlassCard, IllustratedEmptyState, NextSteps, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nimport { GGNOMAD_PROPERTY_QUERY } from '../graphql';\nimport { PageShell } from './PageShell';\nimport { DetailRow, SectionCard } from '../components';\n\nexport function PropertyDetailsPage() {\n const { t } = useI18n();\n const navigate = useNavigate();\n const { id = '' } = useParams();\n const { data } = useQuery(\n GGNOMAD_PROPERTY_QUERY as TypedDocumentNode<\n {\n ggnomadProperty: {\n name: string;\n type: string;\n description?: string;\n currency: string;\n pricePerNight: number;\n maxGuests: number;\n rating?: number;\n provider?: { name: 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 <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: 'book',\n label: t('ggnomad.property.next.book', 'Book this stay'),\n description: t(\n 'ggnomad.property.next.bookDesc',\n 'Reserve these dates and track it under Bookings.'\n ),\n icon: <CalendarCheck className=\"size-4\" />,\n onClick: () => navigate('../../bookings'),\n },\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('..'),\n },\n ]}\n />\n\n <div className=\"grid gap-4 lg:grid-cols-2\">\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 <h2 className=\"mb-4 text-lg font-medium tracking-tight text-text-primary\">\n {t('ggnomad.property.details', 'Details')}\n </h2>\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={property.provider?.name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