@burdenoff/microfe-housingvista 2026.1031.2 → 2026.1102.2
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/housingvista/components/ContactOwnerDialog.d.ts +6 -0
- package/dist/housingvista/components/ContactOwnerDialog.d.ts.map +1 -1
- package/dist/housingvista/components/ContactOwnerDialog.js +39 -29
- package/dist/housingvista/components/ContactOwnerDialog.js.map +1 -1
- package/dist/housingvista/hooks/index.d.ts +12 -14
- package/dist/housingvista/hooks/index.d.ts.map +1 -1
- package/dist/housingvista/hooks/index.js +288 -280
- package/dist/housingvista/hooks/index.js.map +1 -1
- package/dist/housingvista/pages/amc/AMCManagementPage.d.ts.map +1 -1
- package/dist/housingvista/pages/amc/AMCManagementPage.js +205 -194
- package/dist/housingvista/pages/amc/AMCManagementPage.js.map +1 -1
- package/dist/housingvista/pages/amc/AmcContractFormDialog.d.ts.map +1 -1
- package/dist/housingvista/pages/amc/AmcContractFormDialog.js +95 -90
- package/dist/housingvista/pages/amc/AmcContractFormDialog.js.map +1 -1
- package/dist/housingvista/pages/amc/amcDates.d.ts +2 -0
- package/dist/housingvista/pages/amc/amcDates.d.ts.map +1 -1
- package/dist/housingvista/pages/amc/amcDates.js +4 -1
- package/dist/housingvista/pages/amc/amcDates.js.map +1 -1
- package/dist/housingvista/pages/amc/amcStats.d.ts +16 -0
- package/dist/housingvista/pages/amc/amcStats.d.ts.map +1 -0
- package/dist/housingvista/pages/amc/amcStats.js +18 -0
- package/dist/housingvista/pages/amc/amcStats.js.map +1 -0
- package/dist/housingvista/pages/amc/useAmcManagement.d.ts +6 -1
- package/dist/housingvista/pages/amc/useAmcManagement.d.ts.map +1 -1
- package/dist/housingvista/pages/amc/useAmcManagement.js +28 -25
- package/dist/housingvista/pages/amc/useAmcManagement.js.map +1 -1
- package/dist/housingvista/pages/analytics/AnalyticsPage.d.ts.map +1 -1
- package/dist/housingvista/pages/analytics/AnalyticsPage.js +109 -105
- package/dist/housingvista/pages/analytics/AnalyticsPage.js.map +1 -1
- package/dist/housingvista/pages/finance/HomeLoanDetailPage.d.ts.map +1 -1
- package/dist/housingvista/pages/finance/HomeLoanDetailPage.js +161 -152
- package/dist/housingvista/pages/finance/HomeLoanDetailPage.js.map +1 -1
- package/dist/housingvista/pages/finance/HomeLoansPage.d.ts.map +1 -1
- package/dist/housingvista/pages/finance/HomeLoansPage.js +147 -139
- package/dist/housingvista/pages/finance/HomeLoansPage.js.map +1 -1
- package/dist/housingvista/pages/investments/InvestmentsPage.d.ts.map +1 -1
- package/dist/housingvista/pages/investments/InvestmentsPage.js +6 -2
- package/dist/housingvista/pages/investments/InvestmentsPage.js.map +1 -1
- package/dist/housingvista/pages/legal/LegalPage.d.ts.map +1 -1
- package/dist/housingvista/pages/legal/LegalPage.js +6 -1
- package/dist/housingvista/pages/legal/LegalPage.js.map +1 -1
- package/dist/housingvista/pages/marketplace/MarketplacePage.d.ts.map +1 -1
- package/dist/housingvista/pages/marketplace/MarketplacePage.js +6 -1
- package/dist/housingvista/pages/marketplace/MarketplacePage.js.map +1 -1
- package/dist/housingvista/pages/properties/PropertyDetailPage.d.ts.map +1 -1
- package/dist/housingvista/pages/properties/PropertyDetailPage.js +275 -264
- package/dist/housingvista/pages/properties/PropertyDetailPage.js.map +1 -1
- package/dist/housingvista/utils/helpers.d.ts +2 -0
- package/dist/housingvista/utils/helpers.d.ts.map +1 -1
- package/dist/housingvista/utils/helpers.js.map +1 -1
- package/dist/housingvista/utils/loanApplyContext.d.ts +42 -0
- package/dist/housingvista/utils/loanApplyContext.d.ts.map +1 -0
- package/dist/housingvista/utils/loanApplyContext.js +40 -0
- package/dist/housingvista/utils/loanApplyContext.js.map +1 -0
- package/package.json +1 -1
|
@@ -4,22 +4,24 @@ import { StatCard as r } from "../../components/StatCard.js";
|
|
|
4
4
|
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
5
5
|
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
6
6
|
import { FilterBar as o } from "../../components/FilterBar.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { LoadingSkeleton as ee } from "../../components/LoadingSkeleton.js";
|
|
8
|
+
import { useTrackPageView as te } from "../../hooks/useHousingVistaAnalytics.js";
|
|
9
|
+
import { useAMCContracts as s, useAllAmcContracts as ne, useCreateAmcContract as re, useMaintenanceRequests as ie } from "../../hooks/index.js";
|
|
10
|
+
import { notify as c } from "../../lib/toast.js";
|
|
10
11
|
import "../../components/index.js";
|
|
11
|
-
import { useServerPagination as
|
|
12
|
-
import { calendarDaysUntil as
|
|
13
|
-
import { AmcContractFormDialog as
|
|
14
|
-
import { AmcCancelDialog as
|
|
15
|
-
import { useAmcManagement as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
12
|
+
import { useServerPagination as ae } from "../../hooks/useServerPagination.js";
|
|
13
|
+
import { calendarDaysUntil as oe, formatCalendarDate as l } from "./amcDates.js";
|
|
14
|
+
import { AmcContractFormDialog as se } from "./AmcContractFormDialog.js";
|
|
15
|
+
import { AmcCancelDialog as u, AmcDeleteDialog as d, AmcRenewDialog as f } from "./AmcContractActionDialogs.js";
|
|
16
|
+
import { useAmcManagement as p } from "./useAmcManagement.js";
|
|
17
|
+
import { computeAmcStats as m, listScheduledServices as h } from "./amcStats.js";
|
|
18
|
+
import { useEffect as g, useMemo as _, useState as v } from "react";
|
|
19
|
+
import { AlertTriangle as ce, Ban as le, Calendar as y, Clock as ue, Download as de, IndianRupee as fe, MapPin as pe, Pencil as me, Plus as b, RotateCcw as x, Shield as S, Trash2 as he, Wrench as C } from "lucide-react";
|
|
20
|
+
import { useNavigate as ge } from "react-router";
|
|
21
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
22
|
+
import { Button as D, EmphasisPanel as O, NextSteps as k, Pagination as A } from "@burdenoff/fe-libs/ui";
|
|
21
23
|
//#region src/housingvista/pages/amc/AMCManagementPage.tsx
|
|
22
|
-
function
|
|
24
|
+
function j(e) {
|
|
23
25
|
switch (e) {
|
|
24
26
|
case "active": return "success";
|
|
25
27
|
case "expiring_soon": return "warning";
|
|
@@ -28,36 +30,48 @@ function R(e) {
|
|
|
28
30
|
default: return "muted";
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
function M({ onRetry: e }) {
|
|
34
|
+
return /* @__PURE__ */ E("div", {
|
|
35
|
+
role: "alert",
|
|
36
|
+
className: "flex flex-wrap items-center gap-3 text-sm text-status-error-text",
|
|
37
|
+
children: [/* @__PURE__ */ T("span", { children: "Couldn't load every contract, so totals and the schedule are hidden." }), /* @__PURE__ */ T("button", {
|
|
38
|
+
type: "button",
|
|
39
|
+
onClick: e,
|
|
40
|
+
className: "rounded-md border border-border-subtle px-3 py-1 text-xs font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
41
|
+
children: "Retry"
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function N() {
|
|
46
|
+
te("housingvista.amc.viewed");
|
|
47
|
+
let N = ge(), P = ae(10), [F, I] = v(""), [L, _e] = v("");
|
|
48
|
+
g(() => {
|
|
49
|
+
let e = setTimeout(() => _e(F), 300);
|
|
36
50
|
return () => clearTimeout(e);
|
|
37
|
-
}, [
|
|
38
|
-
let { data:
|
|
39
|
-
filter: { search:
|
|
40
|
-
pagination:
|
|
41
|
-
}), { page:
|
|
42
|
-
|
|
43
|
-
!
|
|
51
|
+
}, [F]);
|
|
52
|
+
let { data: R, loading: z } = s({
|
|
53
|
+
filter: { search: L.trim() || void 0 },
|
|
54
|
+
pagination: P.pagination
|
|
55
|
+
}), { page: B, setPage: V } = P;
|
|
56
|
+
g(() => {
|
|
57
|
+
!z && R.length === 0 && B > 1 && V(B - 1);
|
|
44
58
|
}, [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
59
|
+
z,
|
|
60
|
+
R.length,
|
|
61
|
+
B,
|
|
62
|
+
V
|
|
49
63
|
]);
|
|
50
|
-
let { createAmcContract:
|
|
64
|
+
let { data: H, loading: ve, error: U, refetch: W } = ne(), { createAmcContract: ye, loading: be } = re(), { data: xe } = ie({
|
|
51
65
|
filter: { status: "open" },
|
|
52
66
|
pagination: {
|
|
53
67
|
limit: 100,
|
|
54
68
|
offset: 0
|
|
55
69
|
}
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
if (
|
|
60
|
-
|
|
70
|
+
}), Se = xe.length, Ce = (e) => {
|
|
71
|
+
I(e), P.setPage(1);
|
|
72
|
+
}, we = () => {
|
|
73
|
+
if (R.length === 0) {
|
|
74
|
+
c.warning("Nothing to export", "There are no contracts to export yet.");
|
|
61
75
|
return;
|
|
62
76
|
}
|
|
63
77
|
let e = (e) => `"${e.replace(/"/g, "\"\"")}"`, t = [
|
|
@@ -69,7 +83,7 @@ function z() {
|
|
|
69
83
|
"End",
|
|
70
84
|
"Status",
|
|
71
85
|
"Services"
|
|
72
|
-
], n =
|
|
86
|
+
], n = R.map((t) => [
|
|
73
87
|
t.packageName,
|
|
74
88
|
t.propertyTitle,
|
|
75
89
|
t.providerName,
|
|
@@ -79,10 +93,10 @@ function z() {
|
|
|
79
93
|
t.status,
|
|
80
94
|
t.servicesIncluded.join("; ")
|
|
81
95
|
].map((t) => e(String(t))).join(",")), r = [t.map(e).join(","), ...n].join("\n"), i = new Blob([r], { type: "text/csv;charset=utf-8;" }), a = URL.createObjectURL(i), o = document.createElement("a");
|
|
82
|
-
o.href = a, o.download = `housingvista-amc-contracts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(a),
|
|
83
|
-
}, [
|
|
96
|
+
o.href = a, o.download = `housingvista-amc-contracts-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(a), c.success("Export ready", `${R.length} contracts exported to CSV.`);
|
|
97
|
+
}, [Te, G] = v(!1), K = p({ onChanged: () => void W() }), Ee = async (e) => {
|
|
84
98
|
try {
|
|
85
|
-
await
|
|
99
|
+
await ye({
|
|
86
100
|
propertyId: e.propertyId || void 0,
|
|
87
101
|
marketplaceServiceId: e.marketplaceServiceId || void 0,
|
|
88
102
|
propertyTitle: e.propertyTitle,
|
|
@@ -94,14 +108,14 @@ function z() {
|
|
|
94
108
|
status: "active",
|
|
95
109
|
nextServiceDate: e.nextServiceDate || void 0,
|
|
96
110
|
servicesIncluded: e.servicesIncluded.length > 0 ? e.servicesIncluded : void 0
|
|
97
|
-
}),
|
|
111
|
+
}), c.success("Contract created", `${e.packageName} added for ${e.propertyTitle}.`), G(!1), W();
|
|
98
112
|
} catch (e) {
|
|
99
|
-
|
|
113
|
+
c.error("Could not create contract", e.message);
|
|
100
114
|
}
|
|
101
|
-
},
|
|
102
|
-
let t =
|
|
115
|
+
}, q = async (e) => {
|
|
116
|
+
let t = K.editTarget;
|
|
103
117
|
if (t) try {
|
|
104
|
-
await
|
|
118
|
+
await K.updateAmcContract(t.id, {
|
|
105
119
|
propertyId: e.propertyId || null,
|
|
106
120
|
marketplaceServiceId: e.marketplaceServiceId || null,
|
|
107
121
|
propertyTitle: e.propertyTitle,
|
|
@@ -112,277 +126,274 @@ function z() {
|
|
|
112
126
|
endDate: e.endDate,
|
|
113
127
|
nextServiceDate: e.nextServiceDate || null,
|
|
114
128
|
servicesIncluded: e.servicesIncluded
|
|
115
|
-
}),
|
|
129
|
+
}), c.success("Contract updated", `${e.packageName} saved.`), K.setEditTarget(null);
|
|
116
130
|
} catch (e) {
|
|
117
|
-
|
|
131
|
+
c.error("Could not update contract", e.message);
|
|
118
132
|
}
|
|
119
|
-
},
|
|
120
|
-
activeContracts: G.filter((e) => e.status === "active" || e.status === "expiring_soon").length,
|
|
121
|
-
pendingRenewals: G.filter((e) => e.status === "expiring_soon").length,
|
|
122
|
-
totalMonthlySpent: G.filter((e) => e.status === "active" || e.status === "expiring_soon").reduce((e, t) => e + t.monthlyCost, 0),
|
|
123
|
-
upcomingServices: Q.filter((e) => {
|
|
124
|
-
let t = d(e.nextServiceDate);
|
|
125
|
-
return t >= 0 && t <= 30;
|
|
126
|
-
}).length
|
|
127
|
-
}), [G, Q]), he = {
|
|
133
|
+
}, J = () => G(!0), Y = _(() => h(H), [H]), X = _(() => m(H, /* @__PURE__ */ new Date(), Y), [H, Y]), Z = !!U || ve && H.length === 0, Q = (e) => Z ? "—" : e, $ = U ? /* @__PURE__ */ T(M, { onRetry: () => void W() }) : null, De = {
|
|
128
134
|
active: "border-l-4 border-l-status-success-border",
|
|
129
135
|
expiring_soon: "border-l-4 border-l-status-warning-border bg-status-warning-bg-subtle/30",
|
|
130
136
|
expired: "border-l-4 border-l-status-error-border",
|
|
131
137
|
cancelled: "border-l-4 border-l-border-strong"
|
|
132
138
|
};
|
|
133
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ E(n, {
|
|
134
140
|
title: "AMC Management",
|
|
135
141
|
description: "Manage Annual Maintenance Contracts and service packages",
|
|
136
142
|
purpose: "Keep your properties maintained without surprises. Track every Annual Maintenance Contract, see what each covers and costs, get ahead of renewals, and know which services are due in the next 30 days so nothing slips.",
|
|
137
|
-
actions: /* @__PURE__ */
|
|
143
|
+
actions: /* @__PURE__ */ E("div", {
|
|
138
144
|
className: "flex items-center gap-2",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
140
|
-
onClick:
|
|
145
|
+
children: [/* @__PURE__ */ E("button", {
|
|
146
|
+
onClick: we,
|
|
141
147
|
className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
142
|
-
children: [/* @__PURE__ */
|
|
143
|
-
}), /* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ T(de, { className: "h-4 w-4" }), "Export"]
|
|
149
|
+
}), /* @__PURE__ */ E(D, {
|
|
144
150
|
type: "button",
|
|
145
|
-
onClick:
|
|
151
|
+
onClick: J,
|
|
146
152
|
className: "gap-2",
|
|
147
|
-
children: [/* @__PURE__ */
|
|
153
|
+
children: [/* @__PURE__ */ T(b, { className: "h-4 w-4" }), "New Contract"]
|
|
148
154
|
})]
|
|
149
155
|
}),
|
|
150
156
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ E(O, {
|
|
152
158
|
className: "p-4",
|
|
153
|
-
children: /* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ E("div", {
|
|
154
160
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
155
161
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ T(r, {
|
|
157
163
|
label: "Active Contracts",
|
|
158
|
-
value:
|
|
159
|
-
icon: /* @__PURE__ */
|
|
164
|
+
value: Q(X.activeContracts),
|
|
165
|
+
icon: /* @__PURE__ */ T(S, { className: "h-4 w-4" })
|
|
160
166
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ T(r, {
|
|
162
168
|
label: "Pending Renewals",
|
|
163
|
-
value:
|
|
164
|
-
icon: /* @__PURE__ */
|
|
169
|
+
value: Q(X.pendingRenewals),
|
|
170
|
+
icon: /* @__PURE__ */ T(x, { className: "h-4 w-4" })
|
|
165
171
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ T(r, {
|
|
167
173
|
label: "Total Monthly Spent",
|
|
168
|
-
value:
|
|
169
|
-
|
|
170
|
-
icon: /* @__PURE__ */ M(C, { className: "h-4 w-4" })
|
|
174
|
+
value: Z ? "—" : t(X.totalMonthlySpent),
|
|
175
|
+
icon: /* @__PURE__ */ T(fe, { className: "h-4 w-4" })
|
|
171
176
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ T(r, {
|
|
173
178
|
label: "Upcoming Services",
|
|
174
|
-
value:
|
|
175
|
-
icon: /* @__PURE__ */
|
|
179
|
+
value: Q(X.upcomingServices),
|
|
180
|
+
icon: /* @__PURE__ */ T(y, { className: "h-4 w-4" })
|
|
176
181
|
})
|
|
177
182
|
]
|
|
178
|
-
})
|
|
183
|
+
}), $ && /* @__PURE__ */ T("div", {
|
|
184
|
+
className: "mt-3",
|
|
185
|
+
children: $
|
|
186
|
+
})]
|
|
179
187
|
}),
|
|
180
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ T(k, {
|
|
181
189
|
storageKey: "housingvista-amc",
|
|
182
190
|
steps: [
|
|
183
191
|
{
|
|
184
192
|
id: "pick-property",
|
|
185
193
|
label: "Add coverage for a property",
|
|
186
194
|
description: "Choose a property to set up a new maintenance contract.",
|
|
187
|
-
onClick:
|
|
195
|
+
onClick: J
|
|
188
196
|
},
|
|
189
197
|
{
|
|
190
198
|
id: "compare-providers",
|
|
191
199
|
label: "Compare your providers",
|
|
192
200
|
description: "Search by provider name to weigh coverage and monthly cost.",
|
|
193
201
|
onClick: () => {
|
|
194
|
-
let e =
|
|
195
|
-
e && (
|
|
202
|
+
let e = R[0]?.providerName;
|
|
203
|
+
e && (I(e), P.setPage(1));
|
|
196
204
|
}
|
|
197
205
|
},
|
|
198
206
|
{
|
|
199
207
|
id: "check-legal",
|
|
200
208
|
label: "Review contract paperwork",
|
|
201
209
|
description: "Open the legal hub to manage the underlying documents.",
|
|
202
|
-
onClick: () =>
|
|
210
|
+
onClick: () => N("../legal")
|
|
203
211
|
}
|
|
204
212
|
]
|
|
205
213
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ E("div", {
|
|
207
215
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ E("div", {
|
|
209
217
|
className: "space-y-4 lg:col-span-2",
|
|
210
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ E("div", {
|
|
211
219
|
className: "flex flex-col gap-3",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ T("h2", {
|
|
213
221
|
className: "text-lg font-semibold text-text-primary",
|
|
214
222
|
children: "All Contracts"
|
|
215
|
-
}), /* @__PURE__ */
|
|
216
|
-
searchValue:
|
|
217
|
-
onSearchChange:
|
|
223
|
+
}), /* @__PURE__ */ T(o, {
|
|
224
|
+
searchValue: F,
|
|
225
|
+
onSearchChange: Ce,
|
|
218
226
|
searchPlaceholder: "Search contracts, providers, properties..."
|
|
219
227
|
})]
|
|
220
|
-
}),
|
|
228
|
+
}), R.length > 0 ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("div", {
|
|
221
229
|
className: "space-y-3",
|
|
222
|
-
children:
|
|
223
|
-
className: e("rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
230
|
+
children: R.map((n) => /* @__PURE__ */ E("div", {
|
|
231
|
+
className: e("rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm", De[n.status]),
|
|
224
232
|
children: [
|
|
225
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ E("div", {
|
|
226
234
|
className: "flex flex-wrap items-start justify-between gap-2",
|
|
227
|
-
children: [/* @__PURE__ */
|
|
235
|
+
children: [/* @__PURE__ */ E("div", {
|
|
228
236
|
className: "min-w-0",
|
|
229
237
|
children: [
|
|
230
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ E("p", {
|
|
231
239
|
className: "flex items-center gap-1 text-xs text-text-secondary",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
240
|
+
children: [/* @__PURE__ */ T(pe, { className: "h-3 w-3" }), "Property"]
|
|
233
241
|
}),
|
|
234
|
-
n.propertyId ? /* @__PURE__ */
|
|
242
|
+
n.propertyId ? /* @__PURE__ */ T("button", {
|
|
235
243
|
type: "button",
|
|
236
|
-
onClick: () =>
|
|
244
|
+
onClick: () => N(`../properties/${n.propertyId}`),
|
|
237
245
|
className: "block max-w-full truncate text-left text-base font-semibold text-text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
238
246
|
children: n.propertyTitle
|
|
239
|
-
}) : /* @__PURE__ */
|
|
247
|
+
}) : /* @__PURE__ */ T("h3", {
|
|
240
248
|
className: "truncate text-base font-semibold text-text-primary",
|
|
241
249
|
children: n.propertyTitle
|
|
242
250
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ T("p", {
|
|
244
252
|
className: "text-xs text-text-secondary",
|
|
245
253
|
children: n.packageName
|
|
246
254
|
})
|
|
247
255
|
]
|
|
248
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ T(i, {
|
|
249
257
|
label: n.status.replace("_", " "),
|
|
250
|
-
variant:
|
|
258
|
+
variant: j(n.status),
|
|
251
259
|
dot: !0
|
|
252
260
|
})]
|
|
253
261
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ E("div", {
|
|
255
263
|
className: "mt-4 grid grid-cols-2 gap-4 border-t border-border-subtle pt-4 sm:grid-cols-4",
|
|
256
264
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
258
266
|
className: "text-xs text-text-secondary",
|
|
259
267
|
children: "Provider"
|
|
260
|
-
}), n.marketplaceServiceId ? /* @__PURE__ */
|
|
268
|
+
}), n.marketplaceServiceId ? /* @__PURE__ */ T("button", {
|
|
261
269
|
type: "button",
|
|
262
|
-
onClick: () =>
|
|
270
|
+
onClick: () => N(`../marketplace/${n.marketplaceServiceId}`),
|
|
263
271
|
className: "mt-0.5 block max-w-full truncate text-left text-sm font-medium text-text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
264
272
|
children: n.providerName
|
|
265
|
-
}) : /* @__PURE__ */
|
|
273
|
+
}) : /* @__PURE__ */ T("p", {
|
|
266
274
|
className: "mt-0.5 text-sm font-medium text-text-primary",
|
|
267
275
|
children: n.providerName
|
|
268
276
|
})] }),
|
|
269
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
270
278
|
className: "text-xs text-text-secondary",
|
|
271
279
|
children: "Coverage"
|
|
272
|
-
}), /* @__PURE__ */
|
|
280
|
+
}), /* @__PURE__ */ E("p", {
|
|
273
281
|
className: "mt-0.5 truncate text-sm font-medium text-text-primary",
|
|
274
282
|
children: [n.servicesIncluded.length > 0 ? n.servicesIncluded.slice(0, 2).join(", ") : "—", n.servicesIncluded.length > 2 ? ` +${n.servicesIncluded.length - 2}` : ""]
|
|
275
283
|
})] }),
|
|
276
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
277
285
|
className: "text-xs text-text-secondary",
|
|
278
286
|
children: "Monthly Cost"
|
|
279
|
-
}), /* @__PURE__ */
|
|
287
|
+
}), /* @__PURE__ */ E("p", {
|
|
280
288
|
className: "mt-0.5 text-sm font-semibold text-text-primary",
|
|
281
|
-
children: [t(n.monthlyCost), /* @__PURE__ */
|
|
289
|
+
children: [t(n.monthlyCost), /* @__PURE__ */ T("span", {
|
|
282
290
|
className: "text-xs font-normal text-text-secondary",
|
|
283
291
|
children: "/mo"
|
|
284
292
|
})]
|
|
285
293
|
})] }),
|
|
286
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
287
295
|
className: "text-xs text-text-secondary",
|
|
288
296
|
children: "Renewal Date"
|
|
289
|
-
}), /* @__PURE__ */
|
|
297
|
+
}), /* @__PURE__ */ T("p", {
|
|
290
298
|
className: "mt-0.5 text-sm font-medium text-text-primary",
|
|
291
|
-
children:
|
|
299
|
+
children: l(n.endDate)
|
|
292
300
|
})] })
|
|
293
301
|
]
|
|
294
302
|
}),
|
|
295
|
-
n.nextServiceDate && /* @__PURE__ */
|
|
303
|
+
n.nextServiceDate && /* @__PURE__ */ E("p", {
|
|
296
304
|
className: "mt-3 flex items-center gap-1.5 text-xs text-text-secondary",
|
|
297
305
|
children: [
|
|
298
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ T(y, { className: "h-3.5 w-3.5" }),
|
|
299
307
|
"Next service ",
|
|
300
|
-
|
|
308
|
+
l(n.nextServiceDate)
|
|
301
309
|
]
|
|
302
310
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ E("div", {
|
|
304
312
|
className: "mt-3 flex flex-wrap items-center gap-2 border-t border-border-subtle pt-3",
|
|
305
313
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ E(D, {
|
|
307
315
|
type: "button",
|
|
308
316
|
variant: "outline",
|
|
309
317
|
size: "sm",
|
|
310
|
-
onClick: () =>
|
|
311
|
-
children: [/* @__PURE__ */
|
|
318
|
+
onClick: () => K.setEditTarget(n),
|
|
319
|
+
children: [/* @__PURE__ */ T(me, { className: "mr-1.5 h-3.5 w-3.5" }), "Edit"]
|
|
312
320
|
}),
|
|
313
|
-
n.status !== "cancelled" && /* @__PURE__ */
|
|
321
|
+
n.status !== "cancelled" && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ E(D, {
|
|
314
322
|
type: "button",
|
|
315
323
|
variant: "outline",
|
|
316
324
|
size: "sm",
|
|
317
|
-
onClick: () =>
|
|
318
|
-
children: [/* @__PURE__ */
|
|
319
|
-
}), /* @__PURE__ */
|
|
325
|
+
onClick: () => K.openRenew(n),
|
|
326
|
+
children: [/* @__PURE__ */ T(x, { className: "mr-1.5 h-3.5 w-3.5" }), "Renew"]
|
|
327
|
+
}), /* @__PURE__ */ E(D, {
|
|
320
328
|
type: "button",
|
|
321
329
|
variant: "outline",
|
|
322
330
|
size: "sm",
|
|
323
|
-
onClick: () =>
|
|
324
|
-
children: [/* @__PURE__ */
|
|
331
|
+
onClick: () => K.setCancelTarget(n),
|
|
332
|
+
children: [/* @__PURE__ */ T(le, { className: "mr-1.5 h-3.5 w-3.5" }), "Cancel"]
|
|
325
333
|
})] }),
|
|
326
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ E(D, {
|
|
327
335
|
type: "button",
|
|
328
336
|
variant: "outline",
|
|
329
337
|
size: "sm",
|
|
330
338
|
className: "ml-auto text-status-error-text",
|
|
331
|
-
onClick: () =>
|
|
332
|
-
children: [/* @__PURE__ */
|
|
339
|
+
onClick: () => K.setDeleteTarget(n),
|
|
340
|
+
children: [/* @__PURE__ */ T(he, { className: "mr-1.5 h-3.5 w-3.5" }), "Delete"]
|
|
333
341
|
})
|
|
334
342
|
]
|
|
335
343
|
})
|
|
336
344
|
]
|
|
337
345
|
}, n.id))
|
|
338
|
-
}), /* @__PURE__ */
|
|
339
|
-
page:
|
|
340
|
-
pageSize:
|
|
341
|
-
hasNextPage:
|
|
342
|
-
hasPreviousPage:
|
|
343
|
-
onPageChange:
|
|
344
|
-
onPageSizeChange:
|
|
345
|
-
})] }) : /* @__PURE__ */
|
|
346
|
+
}), /* @__PURE__ */ T(A, {
|
|
347
|
+
page: P.page,
|
|
348
|
+
pageSize: P.pageSize,
|
|
349
|
+
hasNextPage: R.length >= P.pageSize,
|
|
350
|
+
hasPreviousPage: P.page > 1,
|
|
351
|
+
onPageChange: P.setPage,
|
|
352
|
+
onPageSizeChange: P.setPageSize
|
|
353
|
+
})] }) : /* @__PURE__ */ T(a, {
|
|
346
354
|
illustration: "empty-search",
|
|
347
|
-
icon: /* @__PURE__ */
|
|
355
|
+
icon: /* @__PURE__ */ T(S, { className: "h-12 w-12" }),
|
|
348
356
|
title: "No contracts found",
|
|
349
357
|
description: "Try adjusting your search criteria or create a new contract.",
|
|
350
|
-
action: /* @__PURE__ */
|
|
358
|
+
action: /* @__PURE__ */ E(D, {
|
|
351
359
|
type: "button",
|
|
352
|
-
onClick:
|
|
360
|
+
onClick: J,
|
|
353
361
|
className: "gap-2",
|
|
354
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ T(b, { className: "h-4 w-4" }), "New Contract"]
|
|
355
363
|
})
|
|
356
364
|
})]
|
|
357
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ E("aside", {
|
|
358
366
|
className: "space-y-6 lg:col-span-1",
|
|
359
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ E("div", {
|
|
360
368
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 shadow-sm",
|
|
361
|
-
children: [/* @__PURE__ */
|
|
369
|
+
children: [/* @__PURE__ */ T("h3", {
|
|
362
370
|
className: "mb-4 text-base font-semibold text-text-primary",
|
|
363
371
|
children: "Upcoming Service Schedule"
|
|
364
|
-
}),
|
|
372
|
+
}), $ || (Z ? /* @__PURE__ */ T(ee, {
|
|
373
|
+
variant: "card",
|
|
374
|
+
count: 2
|
|
375
|
+
}) : Y.length === 0 ? /* @__PURE__ */ T(a, {
|
|
365
376
|
illustration: "empty-generic",
|
|
366
377
|
title: "No services scheduled",
|
|
367
378
|
description: "Upcoming service dates from your active contracts will appear here.",
|
|
368
379
|
className: "border-0 bg-transparent p-4"
|
|
369
|
-
}) : /* @__PURE__ */
|
|
380
|
+
}) : /* @__PURE__ */ T("ol", {
|
|
370
381
|
className: "space-y-4",
|
|
371
|
-
children:
|
|
372
|
-
let n =
|
|
373
|
-
return /* @__PURE__ */
|
|
382
|
+
children: Y.map((t) => {
|
|
383
|
+
let n = oe(t.nextServiceDate), r = n <= 7, i = n < 0;
|
|
384
|
+
return /* @__PURE__ */ E("li", {
|
|
374
385
|
className: "flex gap-3",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
386
|
+
children: [/* @__PURE__ */ T("div", {
|
|
376
387
|
className: e("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", i ? "bg-status-error-bg-subtle" : r ? "bg-status-warning-bg-subtle" : "bg-status-info-bg-subtle"),
|
|
377
|
-
children: i ? /* @__PURE__ */
|
|
378
|
-
}), /* @__PURE__ */
|
|
388
|
+
children: i ? /* @__PURE__ */ T(ce, { className: "h-4 w-4 text-status-error-text" }) : r ? /* @__PURE__ */ T(ue, { className: "h-4 w-4 text-status-warning-text" }) : /* @__PURE__ */ T(C, { className: "h-4 w-4 text-status-info-text" })
|
|
389
|
+
}), /* @__PURE__ */ E("div", {
|
|
379
390
|
className: "min-w-0",
|
|
380
391
|
children: [
|
|
381
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ T("p", {
|
|
382
393
|
className: "text-sm font-medium text-text-primary",
|
|
383
|
-
children:
|
|
394
|
+
children: l(t.nextServiceDate)
|
|
384
395
|
}),
|
|
385
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ E("p", {
|
|
386
397
|
className: "truncate text-sm text-text-primary",
|
|
387
398
|
children: [
|
|
388
399
|
t.packageName,
|
|
@@ -390,11 +401,11 @@ function z() {
|
|
|
390
401
|
t.propertyTitle
|
|
391
402
|
]
|
|
392
403
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ T("p", {
|
|
394
405
|
className: "truncate text-xs text-text-secondary",
|
|
395
406
|
children: t.providerName
|
|
396
407
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ T("p", {
|
|
398
409
|
className: e("text-xs font-medium", i ? "text-status-error-text" : r ? "text-status-warning-text" : "text-text-secondary"),
|
|
399
410
|
children: i ? `${Math.abs(n)} days overdue` : n === 0 ? "Today" : `In ${n} days`
|
|
400
411
|
})
|
|
@@ -402,57 +413,57 @@ function z() {
|
|
|
402
413
|
})]
|
|
403
414
|
}, t.id);
|
|
404
415
|
})
|
|
405
|
-
})]
|
|
406
|
-
}), /* @__PURE__ */
|
|
416
|
+
}))]
|
|
417
|
+
}), /* @__PURE__ */ E("button", {
|
|
407
418
|
type: "button",
|
|
408
|
-
onClick: () =>
|
|
419
|
+
onClick: () => N("../rental"),
|
|
409
420
|
className: "flex w-full items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface p-4 text-left shadow-sm transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ T("div", {
|
|
411
422
|
className: "rounded-lg bg-status-info-bg-subtle p-2.5",
|
|
412
|
-
children: /* @__PURE__ */
|
|
413
|
-
}), /* @__PURE__ */
|
|
423
|
+
children: /* @__PURE__ */ T(C, { className: "h-5 w-5 text-status-info-text" })
|
|
424
|
+
}), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("p", {
|
|
414
425
|
className: "text-sm text-text-secondary",
|
|
415
426
|
children: "Open maintenance requests"
|
|
416
|
-
}), /* @__PURE__ */
|
|
427
|
+
}), /* @__PURE__ */ T("p", {
|
|
417
428
|
className: "text-xl font-bold text-text-primary",
|
|
418
|
-
children:
|
|
429
|
+
children: Se
|
|
419
430
|
})] })]
|
|
420
431
|
})]
|
|
421
432
|
})]
|
|
422
433
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
open:
|
|
434
|
+
/* @__PURE__ */ T(se, {
|
|
435
|
+
open: Te || K.editTarget !== null,
|
|
425
436
|
onOpenChange: (e) => {
|
|
426
|
-
e || (
|
|
437
|
+
e || (G(!1), K.setEditTarget(null));
|
|
427
438
|
},
|
|
428
|
-
contract:
|
|
429
|
-
saving:
|
|
430
|
-
onSubmit:
|
|
439
|
+
contract: K.editTarget,
|
|
440
|
+
saving: be || K.updating,
|
|
441
|
+
onSubmit: K.editTarget ? q : Ee
|
|
431
442
|
}),
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
contract:
|
|
434
|
-
endDate:
|
|
435
|
-
onEndDateChange:
|
|
436
|
-
onClose: () =>
|
|
437
|
-
onSubmit:
|
|
438
|
-
busy:
|
|
443
|
+
/* @__PURE__ */ T(f, {
|
|
444
|
+
contract: K.renewTarget,
|
|
445
|
+
endDate: K.renewEnd,
|
|
446
|
+
onEndDateChange: K.setRenewEnd,
|
|
447
|
+
onClose: () => K.setRenewTarget(null),
|
|
448
|
+
onSubmit: K.handleRenew,
|
|
449
|
+
busy: K.renewing
|
|
439
450
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
contract:
|
|
442
|
-
onClose: () =>
|
|
443
|
-
onConfirm:
|
|
444
|
-
busy:
|
|
451
|
+
/* @__PURE__ */ T(u, {
|
|
452
|
+
contract: K.cancelTarget,
|
|
453
|
+
onClose: () => K.setCancelTarget(null),
|
|
454
|
+
onConfirm: K.confirmCancel,
|
|
455
|
+
busy: K.updating
|
|
445
456
|
}),
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
contract:
|
|
448
|
-
onClose: () =>
|
|
449
|
-
onConfirm:
|
|
450
|
-
busy:
|
|
457
|
+
/* @__PURE__ */ T(d, {
|
|
458
|
+
contract: K.deleteTarget,
|
|
459
|
+
onClose: () => K.setDeleteTarget(null),
|
|
460
|
+
onConfirm: K.confirmDelete,
|
|
461
|
+
busy: K.deleting
|
|
451
462
|
})
|
|
452
463
|
]
|
|
453
464
|
});
|
|
454
465
|
}
|
|
455
466
|
//#endregion
|
|
456
|
-
export {
|
|
467
|
+
export { N as AMCManagementPage };
|
|
457
468
|
|
|
458
469
|
//# sourceMappingURL=AMCManagementPage.js.map
|