@burdenoff/microfe-ggnomad 2026.626.1 → 2026.705.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/LoadMoreButton.js +19 -0
- package/dist/ggnomad/components/LoadMoreButton.js.map +1 -0
- package/dist/ggnomad/components/index.js +1 -0
- package/dist/ggnomad/graphql.js +61 -17
- package/dist/ggnomad/graphql.js.map +1 -1
- package/dist/ggnomad/pages/ActivityDetailsPage.js +55 -53
- package/dist/ggnomad/pages/ActivityDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/AnalyticsPage.js +82 -35
- package/dist/ggnomad/pages/AnalyticsPage.js.map +1 -1
- package/dist/ggnomad/pages/BookingsPage.js +143 -69
- package/dist/ggnomad/pages/BookingsPage.js.map +1 -1
- package/dist/ggnomad/pages/EntertainmentPage.js +43 -34
- package/dist/ggnomad/pages/EntertainmentPage.js.map +1 -1
- package/dist/ggnomad/pages/EventDetailsPage.js +55 -53
- package/dist/ggnomad/pages/EventDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/FavoritesPage.js +98 -38
- package/dist/ggnomad/pages/FavoritesPage.js.map +1 -1
- package/dist/ggnomad/pages/HospitalityPage.js +49 -40
- package/dist/ggnomad/pages/HospitalityPage.js.map +1 -1
- package/dist/ggnomad/pages/PropertyDetailsPage.js +60 -58
- package/dist/ggnomad/pages/PropertyDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/ProviderPage.js +70 -61
- package/dist/ggnomad/pages/ProviderPage.js.map +1 -1
- package/dist/ggnomad/pages/TourDetailsPage.js +55 -53
- package/dist/ggnomad/pages/TourDetailsPage.js.map +1 -1
- package/dist/ggnomad/pages/TourismPage.js +48 -40
- package/dist/ggnomad/pages/TourismPage.js.map +1 -1
- package/dist/ggnomad/utils/notify.js +36 -0
- package/dist/ggnomad/utils/notify.js.map +1 -0
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventDetailsPage.js","names":[],"sources":["../../../src/ggnomad/pages/EventDetailsPage.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, Mic2, Ticket } from 'lucide-react';\nimport { GlassCard, IllustratedEmptyState, NextSteps, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nimport { GGNOMAD_EVENT_QUERY } from '../graphql';\nimport { PageShell } from './PageShell';\nimport { DetailRow, SectionCard } from '../components';\n\nexport function EventDetailsPage() {\n const { t } = useI18n();\n const navigate = useNavigate();\n const { id = '' } = useParams();\n const { data } = useQuery(\n GGNOMAD_EVENT_QUERY as TypedDocumentNode<\n {\n ggnomadEvent: {\n name: string;\n category: string;\n startsAt: string;\n endsAt?: string;\n currency: string;\n price: number;\n performers: string[];\n } | null;\n },\n { id: string }\n >,\n { variables: { id }, skip: !id }\n );\n const event = data?.ggnomadEvent;\n\n return (\n <PageShell\n title={event?.name ?? t('ggnomad.event.fallbackTitle', 'Event details')}\n subtitle={t('ggnomad.event.subtitle', 'Live event details, venue and lineup')}\n >\n {!event ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={t('ggnomad.event.notFoundTitle', 'No event found')}\n description={t(\n 'ggnomad.event.notFoundDescription',\n 'This event is unavailable or may have been removed.'\n )}\n />\n ) : (\n <>\n <PagePurpose icon={<Ticket className=\"size-4\" />}>\n {t(\n 'ggnomad.event.purpose',\n 'All the details for this live event in one place — category, start and end times, ticket price and the full lineup — so you can decide and book tickets before they sell out.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"ggnomad-event-detail\"\n steps={[\n {\n id: 'book',\n label: t('ggnomad.event.next.book', 'Book tickets'),\n description: t(\n 'ggnomad.event.next.bookDesc',\n 'Reserve seats and track them under Bookings.'\n ),\n icon: <CalendarCheck className=\"size-4\" />,\n onClick: () => navigate('
|
|
1
|
+
{"version":3,"file":"EventDetailsPage.js","names":[],"sources":["../../../src/ggnomad/pages/EventDetailsPage.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, Mic2, Ticket } from 'lucide-react';\nimport { GlassCard, IllustratedEmptyState, NextSteps, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nimport { GGNOMAD_EVENT_QUERY } from '../graphql';\nimport { useGGNomad } from '../providers/GGNomadProvider';\nimport { joinPath } from '../utils/navigation';\nimport { PageShell } from './PageShell';\nimport { DetailRow, SectionCard } from '../components';\n\nexport function EventDetailsPage() {\n const { t } = useI18n();\n const navigate = useNavigate();\n const { basePath = '/' } = useGGNomad();\n const { id = '' } = useParams();\n const { data } = useQuery(\n GGNOMAD_EVENT_QUERY as TypedDocumentNode<\n {\n ggnomadEvent: {\n name: string;\n category: string;\n startsAt: string;\n endsAt?: string;\n currency: string;\n price: number;\n performers: string[];\n } | null;\n },\n { id: string }\n >,\n { variables: { id }, skip: !id }\n );\n const event = data?.ggnomadEvent;\n\n return (\n <PageShell\n title={event?.name ?? t('ggnomad.event.fallbackTitle', 'Event details')}\n subtitle={t('ggnomad.event.subtitle', 'Live event details, venue and lineup')}\n >\n {!event ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={t('ggnomad.event.notFoundTitle', 'No event found')}\n description={t(\n 'ggnomad.event.notFoundDescription',\n 'This event is unavailable or may have been removed.'\n )}\n />\n ) : (\n <>\n <PagePurpose icon={<Ticket className=\"size-4\" />}>\n {t(\n 'ggnomad.event.purpose',\n 'All the details for this live event in one place — category, start and end times, ticket price and the full lineup — so you can decide and book tickets before they sell out.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"ggnomad-event-detail\"\n steps={[\n {\n id: 'book',\n label: t('ggnomad.event.next.book', 'Book tickets'),\n description: t(\n 'ggnomad.event.next.bookDesc',\n 'Reserve seats and track them under Bookings.'\n ),\n icon: <CalendarCheck className=\"size-4\" />,\n onClick: () => navigate(joinPath(basePath, 'bookings')),\n },\n {\n id: 'browse',\n label: t('ggnomad.event.next.browse', 'See more events'),\n description: t(\n 'ggnomad.event.next.browseDesc',\n 'Return to Entertainment for other live experiences.'\n ),\n icon: <Ticket className=\"size-4\" />,\n onClick: () => navigate(joinPath(basePath, 'entertainment')),\n },\n ]}\n />\n\n <div className=\"grid gap-4 lg:grid-cols-2\">\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.event.details', 'Details')}\n </h2>\n <dl className=\"space-y-2 text-sm\">\n <DetailRow label={t('ggnomad.event.category', 'Category')} value={event.category} />\n <DetailRow\n label={t('ggnomad.event.starts', 'Starts')}\n value={new Date(event.startsAt).toLocaleString()}\n />\n <DetailRow\n label={t('ggnomad.event.ends', 'Ends')}\n value={\n event.endsAt\n ? new Date(event.endsAt).toLocaleString()\n : t('ggnomad.event.na', 'N/A')\n }\n />\n <DetailRow\n label={t('ggnomad.event.price', 'Price')}\n value={`${event.currency} ${Number(event.price).toFixed(2)}`}\n />\n </dl>\n </GlassCard>\n <SectionCard title={t('ggnomad.event.performers', 'Performers')}>\n <ul className=\"space-y-2 text-sm\">\n {(event.performers ?? []).map((performer) => (\n <li key={performer} className=\"flex items-start gap-2 text-text-primary\">\n <Mic2\n className=\"mt-0.5 size-4 flex-shrink-0 text-action-primary-bg\"\n aria-hidden=\"true\"\n />\n {performer}\n </li>\n ))}\n </ul>\n </SectionCard>\n </div>\n </>\n )}\n </PageShell>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,IAAmB;CACjC,IAAM,EAAE,SAAM,GAAS,EACjB,IAAW,GAAa,EACxB,EAAE,cAAW,QAAQ,GAAY,EACjC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AAO;QACtC,OACE,EAAM,SACF,IAAI,KAAK,EAAM,OAAO,CAAC,gBAAgB,GACvC,EAAE,oBAAoB,MAAM;QAElC,CAAA;OACF,kBAAC,GAAD;QACE,OAAO,EAAE,uBAAuB,QAAQ;QACxC,OAAO,GAAG,EAAM,SAAS,GAAG,OAAO,EAAM,MAAM,CAAC,QAAQ,EAAE;QAC1D,CAAA;OACC;QACK;QACZ,kBAAC,GAAD;KAAa,OAAO,EAAE,4BAA4B,aAAa;eAC7D,kBAAC,MAAD;MAAI,WAAU;iBACV,EAAM,cAAc,EAAE,EAAE,KAAK,MAC7B,kBAAC,MAAD;OAAoB,WAAU;iBAA9B,CACE,kBAAC,GAAD;QACE,WAAU;QACV,eAAY;QACZ,CAAA,EACD,EACE;SANI,EAMJ,CACL;MACC,CAAA;KACO,CAAA,CACV;;GACL,EAAA,CAAA,GAlFH,kBAAC,GAAD;GACE,cAAa;GACb,OAAO,EAAE,+BAA+B,iBAAiB;GACzD,aAAa,EACX,qCACA,sDACD;GACD,CAAA;EA6EM,CAAA"}
|
|
@@ -1,57 +1,117 @@
|
|
|
1
|
-
import { GGNOMAD_FAVORITES_QUERY as e,
|
|
2
|
-
import { PageShell as
|
|
3
|
-
import { EntityCard as
|
|
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
4
|
import "../components/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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";
|
|
10
12
|
//#region src/ggnomad/pages/FavoritesPage.tsx
|
|
11
|
-
function
|
|
12
|
-
let { t:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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, {
|
|
18
80
|
primary: {
|
|
19
|
-
label:
|
|
20
|
-
onSelect: () =>
|
|
21
|
-
|
|
22
|
-
targetType: "PROPERTY",
|
|
23
|
-
targetId: "demo-property"
|
|
24
|
-
} } });
|
|
25
|
-
},
|
|
26
|
-
icon: /* @__PURE__ */ f(i, {})
|
|
81
|
+
label: _("ggnomad.favorites.actions.toggleDemo", "Toggle demo favorite"),
|
|
82
|
+
onSelect: () => void E(),
|
|
83
|
+
icon: /* @__PURE__ */ h(s, {})
|
|
27
84
|
},
|
|
28
85
|
actions: []
|
|
29
86
|
}),
|
|
30
|
-
children: [/* @__PURE__ */
|
|
31
|
-
icon: /* @__PURE__ */
|
|
32
|
-
children:
|
|
33
|
-
}),
|
|
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, {
|
|
34
91
|
illustration: "empty-notifications",
|
|
35
|
-
title:
|
|
36
|
-
description:
|
|
37
|
-
}) : /* @__PURE__ */
|
|
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, {
|
|
38
95
|
treatment: "glass",
|
|
39
96
|
glow: !0,
|
|
40
97
|
className: "border-border-seam p-5",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ h("h2", {
|
|
42
99
|
className: "mb-4 text-lg font-medium tracking-tight text-text-primary",
|
|
43
|
-
children:
|
|
44
|
-
}), /* @__PURE__ */
|
|
100
|
+
children: _("ggnomad.favorites.savedItems", "Saved items")
|
|
101
|
+
}), /* @__PURE__ */ h("div", {
|
|
45
102
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
46
|
-
children:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
+
})
|
|
50
110
|
})]
|
|
51
111
|
})]
|
|
52
112
|
});
|
|
53
113
|
}
|
|
54
114
|
//#endregion
|
|
55
|
-
export {
|
|
115
|
+
export { _ as FavoritesPage };
|
|
56
116
|
|
|
57
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';\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 {
|
|
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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B,EACpE,aAAe,QAAQ,EAAI,UAAU,OAAO,EAAI,CACjD;;;AAIL,QACE,kBAAC,GAAD;EACE,OAAO,EAAE,2BAA2B,YAAY;EAChD,aAAa,EAAE,kCAAkC,YAAY;EAC7D,UAAU,EACR,8BACA,0DACD;EACD,SACE,kBAAC,GAAD;GACE,SAAS;IACP,OAAO,EAAE,wCAAwC,uBAAuB;IACxE,gBAAgB,KAAK,GAAkB;IACvC,MAAM,kBAAC,GAAD,EAAS,CAAA;IAChB;GACD,SAAS,EAAE;GACX,CAAA;YAfN,CAkBE,kBAAC,GAAD;GAAa,MAAM,kBAAC,GAAD,EAAO,WAAU,UAAW,CAAA;aAC5C,EACC,6BACA,+KACD;GACW,CAAA,EAEb,EAAU,WAAW,IACpB,kBAAC,GAAD;GACE,cAAa;GACb,OAAO,EAAE,gCAAgC,qBAAqB;GAC9D,aAAa,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,56 +1,65 @@
|
|
|
1
1
|
import { GGNOMAD_PROPERTIES_QUERY as e } from "../graphql.js";
|
|
2
2
|
import { PageShell as t } from "./PageShell.js";
|
|
3
3
|
import { EntityCard as n } from "../components/EntityCard.js";
|
|
4
|
+
import { LoadMoreButton as r } from "../components/LoadMoreButton.js";
|
|
4
5
|
import "../components/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { useState as i } from "react";
|
|
7
|
+
import { Hotel as a, Star as o } from "lucide-react";
|
|
8
|
+
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
+
import { useQuery as c } from "@apollo/client/react";
|
|
10
|
+
import { GlassCard as l, IllustratedEmptyState as u, PagePurpose as d } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
12
|
//#region src/ggnomad/pages/HospitalityPage.tsx
|
|
11
|
-
function
|
|
12
|
-
let { t:
|
|
13
|
-
first:
|
|
13
|
+
function m() {
|
|
14
|
+
let { t: m } = s(), [h, g] = i(12), { data: _ } = c(e, { variables: {
|
|
15
|
+
first: h,
|
|
14
16
|
skip: 0
|
|
15
|
-
} }),
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
title:
|
|
18
|
-
titleAccent:
|
|
19
|
-
subtitle:
|
|
20
|
-
children: [/* @__PURE__ */
|
|
21
|
-
icon: /* @__PURE__ */
|
|
22
|
-
children:
|
|
23
|
-
}),
|
|
17
|
+
} }), v = _?.ggnomadProperties ?? [];
|
|
18
|
+
return /* @__PURE__ */ p(t, {
|
|
19
|
+
title: m("ggnomad.hospitality.title", "Hospitality"),
|
|
20
|
+
titleAccent: m("ggnomad.hospitality.title.accent", "Hospitality"),
|
|
21
|
+
subtitle: m("ggnomad.hospitality.subtitle", "Property discovery powered by live GraphQL data"),
|
|
22
|
+
children: [/* @__PURE__ */ f(d, {
|
|
23
|
+
icon: /* @__PURE__ */ f(a, { className: "size-4" }),
|
|
24
|
+
children: m("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.")
|
|
25
|
+
}), v.length === 0 ? /* @__PURE__ */ f(u, {
|
|
24
26
|
illustration: "empty-data",
|
|
25
|
-
title:
|
|
26
|
-
description:
|
|
27
|
-
}) : /* @__PURE__ */
|
|
27
|
+
title: m("ggnomad.hospitality.emptyTitle", "No properties available"),
|
|
28
|
+
description: m("ggnomad.hospitality.emptyDescription", "Properties published by providers will be discoverable here.")
|
|
29
|
+
}) : /* @__PURE__ */ p(l, {
|
|
28
30
|
treatment: "glass",
|
|
29
31
|
glow: !0,
|
|
30
32
|
className: "border-border-seam p-5",
|
|
31
|
-
children: [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
className: "
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ f("h2", {
|
|
35
|
+
className: "mb-4 text-lg font-medium tracking-tight text-text-primary",
|
|
36
|
+
children: m("ggnomad.hospitality.featuredStays", "Featured stays")
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ f("div", {
|
|
39
|
+
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
40
|
+
children: v.map((e) => /* @__PURE__ */ f(n, {
|
|
41
|
+
to: e.id,
|
|
42
|
+
title: e.name,
|
|
43
|
+
meta: e.type,
|
|
44
|
+
price: `${e.currency} ${Number(e.pricePerNight).toFixed(2)} ${m("ggnomad.hospitality.card.perNight", "per night")}`,
|
|
45
|
+
footer: /* @__PURE__ */ p("span", {
|
|
46
|
+
className: "inline-flex items-center gap-1 tabular-nums",
|
|
47
|
+
children: [/* @__PURE__ */ f(o, {
|
|
48
|
+
className: "size-3.5 text-status-warning-text",
|
|
49
|
+
"aria-hidden": "true"
|
|
50
|
+
}), e.rating ?? m("ggnomad.hospitality.card.noRating", "N/A")]
|
|
51
|
+
})
|
|
52
|
+
}, e.id))
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ f(r, {
|
|
55
|
+
visible: v.length >= h,
|
|
56
|
+
onLoadMore: () => g((e) => e + 12)
|
|
57
|
+
})
|
|
58
|
+
]
|
|
50
59
|
})]
|
|
51
60
|
});
|
|
52
61
|
}
|
|
53
62
|
//#endregion
|
|
54
|
-
export {
|
|
63
|
+
export { m as HospitalityPage };
|
|
55
64
|
|
|
56
65
|
//# 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 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:
|
|
1
|
+
{"version":3,"file":"HospitalityPage.js","names":[],"sources":["../../../src/ggnomad/pages/HospitalityPage.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 { 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, LoadMoreButton } from '../components';\n\nexport function HospitalityPage() {\n const { t } = useI18n();\n const [limit, setLimit] = useState(12);\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: limit, 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 <LoadMoreButton\n visible={properties.length >= limit}\n onLoadMore={() => setLimit((l) => l + 12)}\n />\n </GlassCard>\n )}\n </PageShell>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,IAAkB;CAChC,IAAM,EAAE,SAAM,GAAS,EACjB,CAAC,GAAO,KAAY,EAAS,GAAG,EAChC,EAAE,YAAS,EACf,GAaA,EAAE,WAAW;EAAE,OAAO;EAAO,MAAM;EAAG,EAAE,CACzC,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;IACE,kBAAC,MAAD;KAAI,WAAU;eACX,EAAE,qCAAqC,iBAAiB;KACtD,CAAA;IACL,kBAAC,OAAD;KAAK,WAAU;eACZ,EAAW,KAAK,MACf,kBAAC,GAAD;MAEE,IAAI,EAAS;MACb,OAAO,EAAS;MAChB,MAAM,EAAS;MACf,OAAO,GAAG,EAAS,SAAS,GAAG,OAAO,EAAS,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG,EAC1E,qCACA,YACD;MACD,QACE,kBAAC,QAAD;OAAM,WAAU;iBAAhB,CACE,kBAAC,GAAD;QAAM,WAAU;QAAoC,eAAY;QAAS,CAAA,EACxE,EAAS,UAAU,EAAE,qCAAqC,MAAM,CAC5D;;MAET,EAdK,EAAS,GAcd,CACF;KACE,CAAA;IACN,kBAAC,GAAD;KACE,SAAS,EAAW,UAAU;KAC9B,kBAAkB,GAAU,MAAM,IAAI,GAAG;KACzC,CAAA;IACQ;KAEJ"}
|
|
@@ -3,102 +3,104 @@ import { PageShell as t } from "./PageShell.js";
|
|
|
3
3
|
import { SectionCard as n } from "../components/SectionCard.js";
|
|
4
4
|
import { DetailRow as r } from "../components/DetailRow.js";
|
|
5
5
|
import "../components/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { useGGNomad as i } from "../providers/GGNomadProvider.js";
|
|
7
|
+
import { joinPath as a } from "../utils/navigation.js";
|
|
8
|
+
import { CalendarCheck as o, Hotel as s } from "lucide-react";
|
|
9
|
+
import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
10
|
+
import { useNavigate as l, useParams as u } from "react-router-dom";
|
|
11
|
+
import { useQuery as d } from "@apollo/client/react";
|
|
12
|
+
import { GlassCard as f, IllustratedEmptyState as p, NextSteps as m, PagePurpose as h } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
12
14
|
//#region src/ggnomad/pages/PropertyDetailsPage.tsx
|
|
13
|
-
function
|
|
14
|
-
let { t:
|
|
15
|
-
variables: { id:
|
|
16
|
-
skip: !
|
|
17
|
-
}),
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
title:
|
|
20
|
-
subtitle:
|
|
21
|
-
children:
|
|
22
|
-
/* @__PURE__ */ h
|
|
23
|
-
icon: /* @__PURE__ */
|
|
24
|
-
children:
|
|
15
|
+
function y() {
|
|
16
|
+
let { t: y } = c(), b = l(), { basePath: x = "/" } = i(), { id: S = "" } = u(), { data: C } = d(e, {
|
|
17
|
+
variables: { id: S },
|
|
18
|
+
skip: !S
|
|
19
|
+
}), w = C?.ggnomadProperty;
|
|
20
|
+
return /* @__PURE__ */ _(t, {
|
|
21
|
+
title: w?.name ?? y("ggnomad.property.fallbackTitle", "Property details"),
|
|
22
|
+
subtitle: y("ggnomad.property.subtitle", "Detailed hospitality listing view"),
|
|
23
|
+
children: w ? /* @__PURE__ */ v(g, { children: [
|
|
24
|
+
/* @__PURE__ */ _(h, {
|
|
25
|
+
icon: /* @__PURE__ */ _(s, { className: "size-4" }),
|
|
26
|
+
children: y("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
27
|
}),
|
|
26
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ _(m, {
|
|
27
29
|
storageKey: "ggnomad-property-detail",
|
|
28
30
|
steps: [{
|
|
29
31
|
id: "book",
|
|
30
|
-
label:
|
|
31
|
-
description:
|
|
32
|
-
icon: /* @__PURE__ */
|
|
33
|
-
onClick: () =>
|
|
32
|
+
label: y("ggnomad.property.next.book", "Book this stay"),
|
|
33
|
+
description: y("ggnomad.property.next.bookDesc", "Reserve these dates and track it under Bookings."),
|
|
34
|
+
icon: /* @__PURE__ */ _(o, { className: "size-4" }),
|
|
35
|
+
onClick: () => b(a(x, "bookings"))
|
|
34
36
|
}, {
|
|
35
37
|
id: "browse",
|
|
36
|
-
label:
|
|
37
|
-
description:
|
|
38
|
-
icon: /* @__PURE__ */
|
|
39
|
-
onClick: () =>
|
|
38
|
+
label: y("ggnomad.property.next.browse", "Compare other stays"),
|
|
39
|
+
description: y("ggnomad.property.next.browseDesc", "Go back to hospitality listings to compare options."),
|
|
40
|
+
icon: /* @__PURE__ */ _(s, { className: "size-4" }),
|
|
41
|
+
onClick: () => b(a(x, "hospitality"))
|
|
40
42
|
}]
|
|
41
43
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ v("div", {
|
|
43
45
|
className: "grid gap-4 lg:grid-cols-2",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
45
|
-
title:
|
|
46
|
+
children: [/* @__PURE__ */ v(n, {
|
|
47
|
+
title: y("ggnomad.property.about", "About"),
|
|
46
48
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ _("p", {
|
|
48
50
|
className: "text-sm text-text-secondary",
|
|
49
|
-
children:
|
|
51
|
+
children: y("ggnomad.property.type", "Type")
|
|
50
52
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ _("p", {
|
|
52
54
|
className: "text-text-primary",
|
|
53
|
-
children:
|
|
55
|
+
children: w.type
|
|
54
56
|
}),
|
|
55
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ _("p", {
|
|
56
58
|
className: "mt-3 text-sm text-text-secondary",
|
|
57
|
-
children:
|
|
59
|
+
children: y("ggnomad.property.description", "Description")
|
|
58
60
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ _("p", {
|
|
60
62
|
className: "text-text-primary",
|
|
61
|
-
children:
|
|
63
|
+
children: w.description ?? y("ggnomad.property.noDescription", "No description")
|
|
62
64
|
})
|
|
63
65
|
]
|
|
64
|
-
}), /* @__PURE__ */
|
|
66
|
+
}), /* @__PURE__ */ v(f, {
|
|
65
67
|
treatment: "glass",
|
|
66
68
|
glow: !0,
|
|
67
69
|
className: "border-border-seam p-5",
|
|
68
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ _("h2", {
|
|
69
71
|
className: "mb-4 text-lg font-medium tracking-tight text-text-primary",
|
|
70
|
-
children:
|
|
71
|
-
}), /* @__PURE__ */
|
|
72
|
+
children: y("ggnomad.property.details", "Details")
|
|
73
|
+
}), /* @__PURE__ */ v("dl", {
|
|
72
74
|
className: "space-y-2 text-sm",
|
|
73
75
|
children: [
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
label:
|
|
76
|
-
value: `${
|
|
76
|
+
/* @__PURE__ */ _(r, {
|
|
77
|
+
label: y("ggnomad.property.price", "Price"),
|
|
78
|
+
value: `${w.currency} ${Number(w.pricePerNight).toFixed(2)}`
|
|
77
79
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
label:
|
|
80
|
-
value: String(
|
|
80
|
+
/* @__PURE__ */ _(r, {
|
|
81
|
+
label: y("ggnomad.property.guests", "Guests"),
|
|
82
|
+
value: String(w.maxGuests)
|
|
81
83
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
label:
|
|
84
|
-
value: String(
|
|
84
|
+
/* @__PURE__ */ _(r, {
|
|
85
|
+
label: y("ggnomad.property.rating", "Rating"),
|
|
86
|
+
value: String(w.rating ?? y("ggnomad.property.noRating", "N/A"))
|
|
85
87
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
label:
|
|
88
|
-
value:
|
|
88
|
+
/* @__PURE__ */ _(r, {
|
|
89
|
+
label: y("ggnomad.property.provider", "Provider"),
|
|
90
|
+
value: w.provider?.name ?? y("ggnomad.property.unassigned", "Unassigned")
|
|
89
91
|
})
|
|
90
92
|
]
|
|
91
93
|
})]
|
|
92
94
|
})]
|
|
93
95
|
})
|
|
94
|
-
] }) : /* @__PURE__ */
|
|
96
|
+
] }) : /* @__PURE__ */ _(p, {
|
|
95
97
|
illustration: "empty-data",
|
|
96
|
-
title:
|
|
97
|
-
description:
|
|
98
|
+
title: y("ggnomad.property.notFoundTitle", "No property found"),
|
|
99
|
+
description: y("ggnomad.property.notFoundDescription", "This property is unavailable or may have been removed.")
|
|
98
100
|
})
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
103
|
//#endregion
|
|
102
|
-
export {
|
|
104
|
+
export { y as PropertyDetailsPage };
|
|
103
105
|
|
|
104
106
|
//# 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 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('
|
|
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 { useGGNomad } from '../providers/GGNomadProvider';\nimport { joinPath } from '../utils/navigation';\nimport { PageShell } from './PageShell';\nimport { DetailRow, SectionCard } from '../components';\n\nexport function PropertyDetailsPage() {\n const { t } = useI18n();\n const navigate = useNavigate();\n const { basePath = '/' } = useGGNomad();\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(joinPath(basePath, '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(joinPath(basePath, 'hospitality')),\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 ?? t('ggnomad.property.unassigned', 'Unassigned')}\n />\n </dl>\n </GlassCard>\n </div>\n </>\n )}\n </PageShell>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,IAAsB;CACpC,IAAM,EAAE,SAAM,GAAS,EACjB,IAAW,GAAa,EACxB,EAAE,cAAW,QAAQ,GAAY,EACjC,EAAE,QAAK,OAAO,GAAW,EACzB,EAAE,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