@burdenoff/microfe-govcitizenhub 2026.720.7 → 2026.730.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/govcitizenhub/GovCitizenHubRoot.d.ts.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoot.js +44 -36
- package/dist/govcitizenhub/GovCitizenHubRoot.js.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoutes.d.ts.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoutes.js +134 -6
- package/dist/govcitizenhub/GovCitizenHubRoutes.js.map +1 -1
- package/dist/govcitizenhub/components/DocumentUploadField.d.ts +17 -11
- package/dist/govcitizenhub/components/DocumentUploadField.d.ts.map +1 -1
- package/dist/govcitizenhub/components/DocumentUploadField.js +45 -42
- package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
- package/dist/govcitizenhub/components/GovCharts.js +127 -51
- package/dist/govcitizenhub/components/GovCharts.js.map +1 -1
- package/dist/govcitizenhub/hooks/index.d.ts +1 -0
- package/dist/govcitizenhub/hooks/index.d.ts.map +1 -1
- package/dist/govcitizenhub/hooks/index.js +1 -0
- package/dist/govcitizenhub/hooks/useGovApi.d.ts +3 -0
- package/dist/govcitizenhub/hooks/useGovApi.d.ts.map +1 -1
- package/dist/govcitizenhub/hooks/useGovApi.js +1 -1
- package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
- package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts +214 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts.map +1 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.js +1140 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.js.map +1 -0
- package/dist/govcitizenhub/index.d.ts +1 -0
- package/dist/govcitizenhub/index.d.ts.map +1 -1
- package/dist/govcitizenhub/index.js +18 -0
- package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +7 -7
- package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +6 -6
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +16 -16
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +35 -35
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +1 -1
- package/dist/govcitizenhub/pages/documents/DocumentsPage.js +5 -5
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +30 -30
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +15 -15
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js +634 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts +20 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js +537 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts +11 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.js +25 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts +15 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js +203 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js +497 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.js +1084 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts +13 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js +581 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts +11 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js +429 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts +8 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js +235 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js +534 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js +723 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js +1029 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.js +1545 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js +960 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts +13 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js +927 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js +620 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts +20 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js +183 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js +629 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js +1125 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js +1518 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js +577 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js +534 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.js +538 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts +53 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js +138 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/index.d.ts +27 -0
- package/dist/govcitizenhub/pages/intelligence/index.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/index.js +17 -0
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js +11 -11
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/PermitsPage.js +6 -6
- package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +8 -8
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +98 -98
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
- package/dist/govcitizenhub/types/index.d.ts +1 -0
- package/dist/govcitizenhub/types/index.d.ts.map +1 -1
- package/dist/govcitizenhub/types/intelligence.d.ts +1559 -0
- package/dist/govcitizenhub/types/intelligence.d.ts.map +1 -0
- package/dist/govcitizenhub/types/intelligence.js +125 -0
- package/dist/govcitizenhub/types/intelligence.js.map +1 -0
- package/dist/index.js +19 -2
- package/dist/node_modules/recharts/es6/chart/BarChart.js +24 -0
- package/dist/node_modules/recharts/es6/chart/BarChart.js.map +1 -0
- package/dist/utils/pageContext.d.ts +1 -0
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +44 -17
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,1518 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { formatDate as t, formatEnumLabel as n, formatNumber as r } from "../../utils/formatters.js";
|
|
3
|
+
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
4
|
+
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
5
|
+
import { useGovCreateProject as o, useGovCreateProjectMilestone as s, useGovDeleteProjectMilestone as c, useGovProject as l, useGovProjects as u, useGovUpdateProject as d, useGovUpdateProjectMilestone as ee, useGovUpdateProjectStatus as f } from "../../hooks/useIntelligenceApi.js";
|
|
6
|
+
import { useCursorPager as p } from "../../hooks/useCursorPager.js";
|
|
7
|
+
import { uploadFileToFiles as te, useFileUrl as m } from "../../hooks/useFiles.js";
|
|
8
|
+
import "../../hooks/index.js";
|
|
9
|
+
import { ErrorView as ne, LoadingView as h } from "../../components/StateViews.js";
|
|
10
|
+
import { SectionCard as g } from "../../components/SectionCard.js";
|
|
11
|
+
import { Pagination as _ } from "../../components/Pagination.js";
|
|
12
|
+
import { describeError as v, notify as y } from "../../lib/toast.js";
|
|
13
|
+
import { GOV_INDICATOR_DOMAIN_LABELS as b, GOV_PROJECT_STATUS_LABELS as x, GOV_VERIFICATION_LABELS as S } from "../../types/intelligence.js";
|
|
14
|
+
import { JurisdictionLayout as C, VerificationChip as w } from "./JurisdictionLayout.js";
|
|
15
|
+
import { ConfirmDialog as T } from "../../components/ConfirmDialog.js";
|
|
16
|
+
import { KeyValueList as E } from "../../components/KeyValueList.js";
|
|
17
|
+
import { TagInput as D } from "../../components/TagInput.js";
|
|
18
|
+
import { useCallback as O, useEffect as k, useMemo as re, useRef as A, useState as j } from "react";
|
|
19
|
+
import { AlertTriangle as M, CalendarClock as N, ExternalLink as P, FileText as F, Flag as ie, Image as I, MapPin as ae, Pencil as oe, Plus as se, Search as ce, Trash2 as le, TrendingUp as ue } from "lucide-react";
|
|
20
|
+
import { useParams as de } from "react-router-dom";
|
|
21
|
+
import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
22
|
+
import { Button as B, GlassCard as fe, Input as V, Label as H, ResponsiveDialog as pe, ResponsiveDialogContent as me, ResponsiveDialogDescription as he, ResponsiveDialogFooter as ge, ResponsiveDialogHeader as _e, ResponsiveDialogTitle as ve, Select as U, SelectContent as W, SelectItem as G, SelectTrigger as K, SelectValue as q, Sheet as ye, SheetContent as be, SheetDescription as xe, SheetHeader as Se, SheetTitle as Ce, Skeleton as we, Switch as Te, Textarea as Ee } from "@burdenoff/fe-libs/ui";
|
|
23
|
+
//#region src/govcitizenhub/pages/intelligence/ProjectsPage.tsx
|
|
24
|
+
var De = 20, J = "ALL", Oe = "/GovCitizenHub/Projects/Documents", ke = "/GovCitizenHub/Projects/Images", Ae = [
|
|
25
|
+
"PLANNED",
|
|
26
|
+
"TENDERED",
|
|
27
|
+
"AWARDED",
|
|
28
|
+
"IN_PROGRESS",
|
|
29
|
+
"SUSPENDED",
|
|
30
|
+
"COMPLETED",
|
|
31
|
+
"CANCELLED"
|
|
32
|
+
], je = [
|
|
33
|
+
"LOCAL_REVENUE",
|
|
34
|
+
"STATE_GRANT",
|
|
35
|
+
"NATIONAL_GRANT",
|
|
36
|
+
"LOAN",
|
|
37
|
+
"INTERNATIONAL_AID",
|
|
38
|
+
"PUBLIC_PRIVATE_PARTNERSHIP",
|
|
39
|
+
"CSR",
|
|
40
|
+
"OTHER"
|
|
41
|
+
], Me = Object.keys(b), Ne = [
|
|
42
|
+
"PENDING",
|
|
43
|
+
"IN_PROGRESS",
|
|
44
|
+
"COMPLETED",
|
|
45
|
+
"DELAYED",
|
|
46
|
+
"CANCELLED"
|
|
47
|
+
], Pe = [
|
|
48
|
+
"UNVERIFIED",
|
|
49
|
+
"OFFICIAL",
|
|
50
|
+
"COMMUNITY_VERIFIED",
|
|
51
|
+
"DISPUTED"
|
|
52
|
+
];
|
|
53
|
+
function Y(e, t) {
|
|
54
|
+
if (e == null || Number.isNaN(e)) return "—";
|
|
55
|
+
let n = (t) => new Intl.NumberFormat(void 0, { maximumFractionDigits: t }).format(e);
|
|
56
|
+
if (!t) return n(2);
|
|
57
|
+
try {
|
|
58
|
+
return new Intl.NumberFormat(void 0, {
|
|
59
|
+
style: "currency",
|
|
60
|
+
currency: t,
|
|
61
|
+
maximumFractionDigits: 0
|
|
62
|
+
}).format(e);
|
|
63
|
+
} catch {
|
|
64
|
+
return `${n(0)} ${t}`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
var Fe = (e) => Math.min(100, Math.max(0, e)), X = (e) => e ? new Date(e).toISOString().slice(0, 10) : "";
|
|
68
|
+
function Z(e) {
|
|
69
|
+
if (!e) return null;
|
|
70
|
+
let t = /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`);
|
|
71
|
+
return Number.isNaN(t.getTime()) ? null : t.toISOString();
|
|
72
|
+
}
|
|
73
|
+
function Q(e) {
|
|
74
|
+
let t = e.trim();
|
|
75
|
+
if (!t) return null;
|
|
76
|
+
let n = Number(t);
|
|
77
|
+
return Number.isFinite(n) ? n : null;
|
|
78
|
+
}
|
|
79
|
+
function Ie(e, t = 350) {
|
|
80
|
+
let [n, r] = j(""), [i, a] = j(""), o = A(null);
|
|
81
|
+
return k(() => () => {
|
|
82
|
+
o.current && clearTimeout(o.current);
|
|
83
|
+
}, []), {
|
|
84
|
+
input: n,
|
|
85
|
+
committed: i,
|
|
86
|
+
change: O((n) => {
|
|
87
|
+
r(n), o.current && clearTimeout(o.current), o.current = setTimeout(() => {
|
|
88
|
+
a(n), e();
|
|
89
|
+
}, t);
|
|
90
|
+
}, [t, e])
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
var Le = ({ delayDays: e }) => /* @__PURE__ */ z("span", {
|
|
94
|
+
className: "inline-flex items-center gap-1 rounded-full bg-status-error-bg-subtle px-2.5 py-0.5 text-xs font-medium text-status-error-text",
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ R(M, {
|
|
97
|
+
className: "size-3",
|
|
98
|
+
"aria-hidden": "true"
|
|
99
|
+
}),
|
|
100
|
+
e,
|
|
101
|
+
" ",
|
|
102
|
+
e === 1 ? "day" : "days",
|
|
103
|
+
" late"
|
|
104
|
+
]
|
|
105
|
+
}), $ = ({ percent: t, className: n }) => {
|
|
106
|
+
let r = Fe(t);
|
|
107
|
+
return /* @__PURE__ */ z("div", {
|
|
108
|
+
className: e("flex items-center gap-2", n),
|
|
109
|
+
children: [/* @__PURE__ */ R("div", {
|
|
110
|
+
className: "h-2 w-24 shrink-0 overflow-hidden rounded-full bg-bg-sunken",
|
|
111
|
+
role: "progressbar",
|
|
112
|
+
"aria-valuenow": r,
|
|
113
|
+
"aria-valuemin": 0,
|
|
114
|
+
"aria-valuemax": 100,
|
|
115
|
+
children: /* @__PURE__ */ R("div", {
|
|
116
|
+
className: "h-full rounded-full bg-action-primary-bg",
|
|
117
|
+
style: { width: `${r}%` }
|
|
118
|
+
})
|
|
119
|
+
}), /* @__PURE__ */ z("span", {
|
|
120
|
+
className: "text-xs tabular-nums text-text-secondary",
|
|
121
|
+
children: [r, "%"]
|
|
122
|
+
})]
|
|
123
|
+
});
|
|
124
|
+
}, Re = ({ fileId: e, icon: t, label: n }) => {
|
|
125
|
+
let { data: r, isLoading: i, isError: a } = m(e);
|
|
126
|
+
return i ? /* @__PURE__ */ R(we, { className: "h-9 w-40 rounded-lg" }) : a || !r ? /* @__PURE__ */ z("span", {
|
|
127
|
+
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm text-text-muted",
|
|
128
|
+
children: [
|
|
129
|
+
t,
|
|
130
|
+
" ",
|
|
131
|
+
n,
|
|
132
|
+
" unavailable"
|
|
133
|
+
]
|
|
134
|
+
}) : /* @__PURE__ */ z("a", {
|
|
135
|
+
href: r,
|
|
136
|
+
target: "_blank",
|
|
137
|
+
rel: "noreferrer",
|
|
138
|
+
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary transition-colors hover:bg-bg-sunken",
|
|
139
|
+
children: [
|
|
140
|
+
t,
|
|
141
|
+
" ",
|
|
142
|
+
n,
|
|
143
|
+
" ",
|
|
144
|
+
/* @__PURE__ */ R(P, {
|
|
145
|
+
className: "size-3.5",
|
|
146
|
+
"aria-hidden": "true"
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
});
|
|
150
|
+
}, ze = () => {
|
|
151
|
+
let { jurisdictionId: t } = de(), r = p(), [o, s] = j(J), [c, l] = j(J), [d, ee] = j(J), [f, te] = j(!1), [m, g] = j(null), [v, y] = j(null), [S, w] = j(!1), T = Ie(r.reset), E = Ie(r.reset), { data: D, isLoading: O, isError: k, refetch: A } = u(re(() => ({
|
|
152
|
+
jurisdictionId: t,
|
|
153
|
+
status: o === J ? void 0 : o,
|
|
154
|
+
domain: c === J ? void 0 : c,
|
|
155
|
+
fundingSource: d === J ? void 0 : d,
|
|
156
|
+
department: E.committed.trim() || void 0,
|
|
157
|
+
search: T.committed.trim() || void 0,
|
|
158
|
+
delayedOnly: f || void 0
|
|
159
|
+
}), [
|
|
160
|
+
t,
|
|
161
|
+
o,
|
|
162
|
+
c,
|
|
163
|
+
d,
|
|
164
|
+
E.committed,
|
|
165
|
+
T.committed,
|
|
166
|
+
f
|
|
167
|
+
]), {
|
|
168
|
+
limit: De,
|
|
169
|
+
cursor: r.cursor
|
|
170
|
+
}), M = re(() => D?.items ?? [], [D]), N = o !== J || c !== J || d !== J || f || !!T.committed.trim() || !!E.committed.trim(), P = () => {
|
|
171
|
+
y(null), w(!0);
|
|
172
|
+
}, F = (e) => {
|
|
173
|
+
y(e), w(!0);
|
|
174
|
+
}, ie = (e) => {
|
|
175
|
+
s(e), r.reset();
|
|
176
|
+
}, I = (e) => {
|
|
177
|
+
l(e), r.reset();
|
|
178
|
+
}, ae = (e) => {
|
|
179
|
+
ee(e), r.reset();
|
|
180
|
+
};
|
|
181
|
+
return /* @__PURE__ */ z(C, {
|
|
182
|
+
description: "Public works and development projects, their money, delivery timeline and delays.",
|
|
183
|
+
actions: /* @__PURE__ */ z(B, {
|
|
184
|
+
onClick: P,
|
|
185
|
+
children: [/* @__PURE__ */ R(se, {
|
|
186
|
+
className: "mr-1.5 h-4 w-4",
|
|
187
|
+
"aria-hidden": "true"
|
|
188
|
+
}), " New project"]
|
|
189
|
+
}),
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ z("div", {
|
|
192
|
+
className: "mb-5 flex flex-wrap items-center gap-2",
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ z("div", {
|
|
195
|
+
className: "relative min-w-[14rem] flex-1",
|
|
196
|
+
children: [/* @__PURE__ */ R(ce, {
|
|
197
|
+
className: "pointer-events-none absolute left-3.5 top-1/2 size-4 -translate-y-1/2 text-text-muted",
|
|
198
|
+
"aria-hidden": "true"
|
|
199
|
+
}), /* @__PURE__ */ R(V, {
|
|
200
|
+
value: T.input,
|
|
201
|
+
onChange: (e) => T.change(e.target.value),
|
|
202
|
+
placeholder: "Search projects…",
|
|
203
|
+
"aria-label": "Search projects",
|
|
204
|
+
className: "h-10 pl-10"
|
|
205
|
+
})]
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ z(U, {
|
|
208
|
+
value: o,
|
|
209
|
+
onValueChange: (e) => ie(e),
|
|
210
|
+
children: [/* @__PURE__ */ R(K, {
|
|
211
|
+
className: "w-40",
|
|
212
|
+
"aria-label": "Filter by status",
|
|
213
|
+
children: /* @__PURE__ */ R(q, {})
|
|
214
|
+
}), /* @__PURE__ */ z(W, { children: [/* @__PURE__ */ R(G, {
|
|
215
|
+
value: J,
|
|
216
|
+
children: "All statuses"
|
|
217
|
+
}), Ae.map((e) => /* @__PURE__ */ R(G, {
|
|
218
|
+
value: e,
|
|
219
|
+
children: x[e]
|
|
220
|
+
}, e))] })]
|
|
221
|
+
}),
|
|
222
|
+
/* @__PURE__ */ z(U, {
|
|
223
|
+
value: c,
|
|
224
|
+
onValueChange: (e) => I(e),
|
|
225
|
+
children: [/* @__PURE__ */ R(K, {
|
|
226
|
+
className: "w-44",
|
|
227
|
+
"aria-label": "Filter by sector",
|
|
228
|
+
children: /* @__PURE__ */ R(q, {})
|
|
229
|
+
}), /* @__PURE__ */ z(W, { children: [/* @__PURE__ */ R(G, {
|
|
230
|
+
value: J,
|
|
231
|
+
children: "All sectors"
|
|
232
|
+
}), Me.map((e) => /* @__PURE__ */ R(G, {
|
|
233
|
+
value: e,
|
|
234
|
+
children: b[e]
|
|
235
|
+
}, e))] })]
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ z(U, {
|
|
238
|
+
value: d,
|
|
239
|
+
onValueChange: (e) => ae(e),
|
|
240
|
+
children: [/* @__PURE__ */ R(K, {
|
|
241
|
+
className: "w-48",
|
|
242
|
+
"aria-label": "Filter by funding source",
|
|
243
|
+
children: /* @__PURE__ */ R(q, {})
|
|
244
|
+
}), /* @__PURE__ */ z(W, { children: [/* @__PURE__ */ R(G, {
|
|
245
|
+
value: J,
|
|
246
|
+
children: "All funding sources"
|
|
247
|
+
}), je.map((e) => /* @__PURE__ */ R(G, {
|
|
248
|
+
value: e,
|
|
249
|
+
children: n(e)
|
|
250
|
+
}, e))] })]
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ R(V, {
|
|
253
|
+
value: E.input,
|
|
254
|
+
onChange: (e) => E.change(e.target.value),
|
|
255
|
+
placeholder: "Department",
|
|
256
|
+
"aria-label": "Filter by department",
|
|
257
|
+
className: "h-10 w-44"
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ z("div", {
|
|
260
|
+
className: "flex items-center gap-2 rounded-xl border border-border-seam bg-bg-surface px-3 py-2",
|
|
261
|
+
children: [/* @__PURE__ */ R(Te, {
|
|
262
|
+
checked: f,
|
|
263
|
+
onCheckedChange: (e) => {
|
|
264
|
+
te(e), r.reset();
|
|
265
|
+
},
|
|
266
|
+
"aria-label": "Show delayed projects only"
|
|
267
|
+
}), /* @__PURE__ */ R("span", {
|
|
268
|
+
className: "text-sm text-text-secondary",
|
|
269
|
+
children: "Delayed only"
|
|
270
|
+
})]
|
|
271
|
+
})
|
|
272
|
+
]
|
|
273
|
+
}),
|
|
274
|
+
O ? /* @__PURE__ */ R(h, { label: "Loading projects…" }) : k ? /* @__PURE__ */ R(ne, {
|
|
275
|
+
message: "We couldn't load projects for this jurisdiction.",
|
|
276
|
+
onRetry: () => {
|
|
277
|
+
A();
|
|
278
|
+
}
|
|
279
|
+
}) : M.length === 0 ? /* @__PURE__ */ R(a, {
|
|
280
|
+
illustration: "empty-data",
|
|
281
|
+
title: N ? "No projects match these filters" : "No projects published yet",
|
|
282
|
+
description: N ? "Try widening the filters to see more of this region’s delivery pipeline." : "Publish a public works or development project so citizens can follow its delivery.",
|
|
283
|
+
action: N ? void 0 : /* @__PURE__ */ z(B, {
|
|
284
|
+
onClick: P,
|
|
285
|
+
children: [/* @__PURE__ */ R(se, {
|
|
286
|
+
className: "mr-1.5 h-4 w-4",
|
|
287
|
+
"aria-hidden": "true"
|
|
288
|
+
}), " New project"]
|
|
289
|
+
})
|
|
290
|
+
}) : /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(fe, {
|
|
291
|
+
treatment: "plain",
|
|
292
|
+
className: "overflow-hidden border-border-seam p-0",
|
|
293
|
+
children: /* @__PURE__ */ R("div", {
|
|
294
|
+
className: "overflow-x-auto",
|
|
295
|
+
children: /* @__PURE__ */ z("table", {
|
|
296
|
+
className: "w-full min-w-[64rem] text-left text-sm",
|
|
297
|
+
children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ z("tr", {
|
|
298
|
+
className: "border-b border-border-seam text-xs uppercase tracking-wide text-text-muted",
|
|
299
|
+
children: [
|
|
300
|
+
/* @__PURE__ */ R("th", {
|
|
301
|
+
className: "px-5 py-3 font-medium",
|
|
302
|
+
children: "Project"
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ R("th", {
|
|
305
|
+
className: "px-5 py-3 font-medium",
|
|
306
|
+
children: "Department"
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ R("th", {
|
|
309
|
+
className: "px-5 py-3 font-medium",
|
|
310
|
+
children: "Contractor"
|
|
311
|
+
}),
|
|
312
|
+
/* @__PURE__ */ R("th", {
|
|
313
|
+
className: "px-5 py-3 font-medium",
|
|
314
|
+
children: "Funding"
|
|
315
|
+
}),
|
|
316
|
+
/* @__PURE__ */ R("th", {
|
|
317
|
+
className: "px-5 py-3 text-right font-medium",
|
|
318
|
+
children: "Budget vs actual"
|
|
319
|
+
}),
|
|
320
|
+
/* @__PURE__ */ R("th", {
|
|
321
|
+
className: "px-5 py-3 font-medium",
|
|
322
|
+
children: "Progress"
|
|
323
|
+
}),
|
|
324
|
+
/* @__PURE__ */ R("th", {
|
|
325
|
+
className: "px-5 py-3 font-medium",
|
|
326
|
+
children: "Status"
|
|
327
|
+
})
|
|
328
|
+
]
|
|
329
|
+
}) }), /* @__PURE__ */ R("tbody", {
|
|
330
|
+
className: "divide-y divide-border-subtle",
|
|
331
|
+
children: M.map((t) => {
|
|
332
|
+
let r = t.costVariance != null && t.costVariance > 0 ? "text-status-error-text" : "text-status-success-text";
|
|
333
|
+
return /* @__PURE__ */ z("tr", {
|
|
334
|
+
className: "transition-colors hover:bg-bg-sunken",
|
|
335
|
+
children: [
|
|
336
|
+
/* @__PURE__ */ z("td", {
|
|
337
|
+
className: "px-5 py-4",
|
|
338
|
+
children: [/* @__PURE__ */ R("button", {
|
|
339
|
+
type: "button",
|
|
340
|
+
onClick: () => g(t.id),
|
|
341
|
+
className: "text-left font-medium text-text-primary underline-offset-2 hover:underline focus-visible:outline-none focus-visible:underline",
|
|
342
|
+
children: t.name
|
|
343
|
+
}), /* @__PURE__ */ z("p", {
|
|
344
|
+
className: "text-xs text-text-muted",
|
|
345
|
+
children: [t.code ? `${t.code} · ` : "", b[t.domain]]
|
|
346
|
+
})]
|
|
347
|
+
}),
|
|
348
|
+
/* @__PURE__ */ R("td", {
|
|
349
|
+
className: "px-5 py-4 text-text-secondary",
|
|
350
|
+
children: t.department || "—"
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ R("td", {
|
|
353
|
+
className: "px-5 py-4 text-text-secondary",
|
|
354
|
+
children: t.contractorName || "—"
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ R("td", {
|
|
357
|
+
className: "px-5 py-4",
|
|
358
|
+
children: /* @__PURE__ */ R("span", {
|
|
359
|
+
className: "inline-flex rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
360
|
+
children: n(t.fundingSource)
|
|
361
|
+
})
|
|
362
|
+
}),
|
|
363
|
+
/* @__PURE__ */ z("td", {
|
|
364
|
+
className: "px-5 py-4 text-right whitespace-nowrap",
|
|
365
|
+
children: [
|
|
366
|
+
/* @__PURE__ */ R("p", {
|
|
367
|
+
className: "tabular-nums text-text-primary",
|
|
368
|
+
children: Y(t.budgetAmount, t.currencyCode)
|
|
369
|
+
}),
|
|
370
|
+
/* @__PURE__ */ R("p", {
|
|
371
|
+
className: "text-xs tabular-nums text-text-muted",
|
|
372
|
+
children: t.actualCost == null ? "No actual cost reported" : `Actual ${Y(t.actualCost, t.currencyCode)}`
|
|
373
|
+
}),
|
|
374
|
+
t.costVariance != null && t.costVariance !== 0 && /* @__PURE__ */ z("p", {
|
|
375
|
+
className: e("text-xs tabular-nums", r),
|
|
376
|
+
children: [t.costVariance > 0 ? "+" : "", Y(t.costVariance, t.currencyCode)]
|
|
377
|
+
})
|
|
378
|
+
]
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ R("td", {
|
|
381
|
+
className: "px-5 py-4",
|
|
382
|
+
children: /* @__PURE__ */ R($, { percent: t.progressPercent })
|
|
383
|
+
}),
|
|
384
|
+
/* @__PURE__ */ R("td", {
|
|
385
|
+
className: "px-5 py-4",
|
|
386
|
+
children: /* @__PURE__ */ z("div", {
|
|
387
|
+
className: "flex flex-col items-start gap-1.5",
|
|
388
|
+
children: [/* @__PURE__ */ R(i, { status: t.status }), t.delayDays != null && t.delayDays > 0 && /* @__PURE__ */ R(Le, { delayDays: t.delayDays })]
|
|
389
|
+
})
|
|
390
|
+
})
|
|
391
|
+
]
|
|
392
|
+
}, t.id);
|
|
393
|
+
})
|
|
394
|
+
})]
|
|
395
|
+
})
|
|
396
|
+
})
|
|
397
|
+
}), /* @__PURE__ */ R(_, {
|
|
398
|
+
page: r.page,
|
|
399
|
+
pageSize: De,
|
|
400
|
+
itemCount: M.length,
|
|
401
|
+
hasMore: D?.pageInfo.hasMore ?? !1,
|
|
402
|
+
onPageChange: (e) => r.onPageChange(e, D?.pageInfo.cursor)
|
|
403
|
+
})] }),
|
|
404
|
+
m && /* @__PURE__ */ R(Be, {
|
|
405
|
+
projectId: m,
|
|
406
|
+
onClose: () => g(null),
|
|
407
|
+
onEdit: (e) => {
|
|
408
|
+
g(null), F(e);
|
|
409
|
+
}
|
|
410
|
+
}),
|
|
411
|
+
S && t && /* @__PURE__ */ R(Ue, {
|
|
412
|
+
jurisdictionId: t,
|
|
413
|
+
project: v,
|
|
414
|
+
onOpenChange: w,
|
|
415
|
+
onSaved: (e) => g(e.id)
|
|
416
|
+
})
|
|
417
|
+
]
|
|
418
|
+
});
|
|
419
|
+
}, Be = ({ projectId: e, onClose: a, onEdit: o }) => {
|
|
420
|
+
let { data: s, isLoading: u, isError: d, refetch: ee } = l(e), [f, p] = j(!1), [te, m] = j(null), [_, x] = j(!1), [C, D] = j(null), O = c(), k = re(() => [...s?.milestones ?? []].sort((e, t) => e.displayOrder - t.displayOrder || e.name.localeCompare(t.name)), [s?.milestones]), A = s ? [
|
|
421
|
+
{
|
|
422
|
+
label: "Sector",
|
|
423
|
+
value: b[s.domain]
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
label: "Department",
|
|
427
|
+
value: s.department ?? ""
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
label: "Contractor",
|
|
431
|
+
value: s.contractorName ? `${s.contractorName}${s.contractorRegistrationId ? ` (${s.contractorRegistrationId})` : ""}` : ""
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
label: "Funding source",
|
|
435
|
+
value: n(s.fundingSource)
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
label: "Budget",
|
|
439
|
+
value: Y(s.budgetAmount, s.currencyCode)
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
label: "Actual cost",
|
|
443
|
+
value: Y(s.actualCost, s.currencyCode)
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
label: "Cost variance",
|
|
447
|
+
value: s.costVariance == null ? "" : /* @__PURE__ */ z("span", {
|
|
448
|
+
className: s.costVariance > 0 ? "text-status-error-text" : "text-status-success-text",
|
|
449
|
+
children: [s.costVariance > 0 ? "+" : "", Y(s.costVariance, s.currencyCode)]
|
|
450
|
+
})
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
label: "Beneficiaries",
|
|
454
|
+
value: s.beneficiaryCount == null ? "" : r(s.beneficiaryCount)
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
label: "Tender reference",
|
|
458
|
+
value: s.tenderUrl ? /* @__PURE__ */ z("a", {
|
|
459
|
+
href: s.tenderUrl,
|
|
460
|
+
target: "_blank",
|
|
461
|
+
rel: "noreferrer",
|
|
462
|
+
className: "inline-flex items-center gap-1 underline underline-offset-2",
|
|
463
|
+
children: [s.tenderReference ?? "Tender notice", /* @__PURE__ */ R(P, {
|
|
464
|
+
className: "size-3",
|
|
465
|
+
"aria-hidden": "true"
|
|
466
|
+
})]
|
|
467
|
+
}) : s.tenderReference ?? ""
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
label: "Awarded on",
|
|
471
|
+
value: s.awardedOn ? t(s.awardedOn) : ""
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
label: "Start date",
|
|
475
|
+
value: s.startDate ? t(s.startDate) : ""
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
label: "Planned completion",
|
|
479
|
+
value: s.plannedCompletionDate ? t(s.plannedCompletionDate) : ""
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
label: "Actual completion",
|
|
483
|
+
value: s.actualCompletionDate ? t(s.actualCompletionDate) : ""
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
label: "Location",
|
|
487
|
+
value: s.locationLabel ? /* @__PURE__ */ z("span", {
|
|
488
|
+
className: "inline-flex items-center gap-1.5",
|
|
489
|
+
children: [
|
|
490
|
+
/* @__PURE__ */ R(ae, {
|
|
491
|
+
className: "size-3.5 text-text-muted",
|
|
492
|
+
"aria-hidden": "true"
|
|
493
|
+
}),
|
|
494
|
+
s.locationLabel,
|
|
495
|
+
s.latitude != null && s.longitude != null && /* @__PURE__ */ z("span", {
|
|
496
|
+
className: "text-xs text-text-muted tabular-nums",
|
|
497
|
+
children: [
|
|
498
|
+
s.latitude.toFixed(5),
|
|
499
|
+
", ",
|
|
500
|
+
s.longitude.toFixed(5)
|
|
501
|
+
]
|
|
502
|
+
})
|
|
503
|
+
]
|
|
504
|
+
}) : s.latitude != null && s.longitude != null ? /* @__PURE__ */ z("span", {
|
|
505
|
+
className: "text-xs text-text-muted tabular-nums",
|
|
506
|
+
children: [
|
|
507
|
+
s.latitude.toFixed(5),
|
|
508
|
+
", ",
|
|
509
|
+
s.longitude.toFixed(5)
|
|
510
|
+
]
|
|
511
|
+
}) : ""
|
|
512
|
+
}
|
|
513
|
+
] : [];
|
|
514
|
+
return /* @__PURE__ */ z(L, { children: [
|
|
515
|
+
/* @__PURE__ */ R(ye, {
|
|
516
|
+
open: !0,
|
|
517
|
+
onOpenChange: (e) => {
|
|
518
|
+
e || a();
|
|
519
|
+
},
|
|
520
|
+
children: /* @__PURE__ */ z(be, {
|
|
521
|
+
side: "right",
|
|
522
|
+
className: "w-full gap-0 p-0 sm:max-w-2xl",
|
|
523
|
+
children: [/* @__PURE__ */ z(Se, {
|
|
524
|
+
className: "border-b border-border-seam px-5 py-4",
|
|
525
|
+
children: [
|
|
526
|
+
/* @__PURE__ */ R(Ce, {
|
|
527
|
+
className: "pr-8 text-lg font-semibold text-text-primary",
|
|
528
|
+
children: s?.name ?? "Project"
|
|
529
|
+
}),
|
|
530
|
+
/* @__PURE__ */ R(xe, {
|
|
531
|
+
className: "text-sm text-text-secondary",
|
|
532
|
+
children: s ? [s.code, b[s.domain]].filter(Boolean).join(" · ") : "Loading project…"
|
|
533
|
+
}),
|
|
534
|
+
s && /* @__PURE__ */ z("div", {
|
|
535
|
+
className: "flex flex-wrap items-center gap-2 pt-1",
|
|
536
|
+
children: [
|
|
537
|
+
/* @__PURE__ */ R(i, {
|
|
538
|
+
status: s.status,
|
|
539
|
+
size: "md"
|
|
540
|
+
}),
|
|
541
|
+
s.delayDays != null && s.delayDays > 0 && /* @__PURE__ */ R(Le, { delayDays: s.delayDays }),
|
|
542
|
+
/* @__PURE__ */ R(w, { status: s.verification }),
|
|
543
|
+
/* @__PURE__ */ R($, {
|
|
544
|
+
percent: s.progressPercent,
|
|
545
|
+
className: "ml-auto"
|
|
546
|
+
})
|
|
547
|
+
]
|
|
548
|
+
})
|
|
549
|
+
]
|
|
550
|
+
}), /* @__PURE__ */ R("div", {
|
|
551
|
+
className: "flex-1 overflow-y-auto px-5 py-4",
|
|
552
|
+
children: u ? /* @__PURE__ */ R(h, { label: "Loading project…" }) : d || !s ? /* @__PURE__ */ R(ne, {
|
|
553
|
+
message: "We couldn't load this project.",
|
|
554
|
+
onRetry: () => {
|
|
555
|
+
ee();
|
|
556
|
+
}
|
|
557
|
+
}) : /* @__PURE__ */ z("div", {
|
|
558
|
+
className: "space-y-4",
|
|
559
|
+
children: [
|
|
560
|
+
/* @__PURE__ */ z("div", {
|
|
561
|
+
className: "flex flex-wrap gap-2",
|
|
562
|
+
children: [
|
|
563
|
+
/* @__PURE__ */ z(B, {
|
|
564
|
+
size: "sm",
|
|
565
|
+
variant: "outline",
|
|
566
|
+
onClick: () => o(s),
|
|
567
|
+
children: [/* @__PURE__ */ R(oe, {
|
|
568
|
+
className: "mr-1.5 h-4 w-4",
|
|
569
|
+
"aria-hidden": "true"
|
|
570
|
+
}), " Edit project"]
|
|
571
|
+
}),
|
|
572
|
+
/* @__PURE__ */ z(B, {
|
|
573
|
+
size: "sm",
|
|
574
|
+
variant: "outline",
|
|
575
|
+
onClick: () => p(!0),
|
|
576
|
+
children: [/* @__PURE__ */ R(ue, {
|
|
577
|
+
className: "mr-1.5 h-4 w-4",
|
|
578
|
+
"aria-hidden": "true"
|
|
579
|
+
}), " Update status"]
|
|
580
|
+
}),
|
|
581
|
+
/* @__PURE__ */ z(B, {
|
|
582
|
+
size: "sm",
|
|
583
|
+
variant: "outline",
|
|
584
|
+
onClick: () => {
|
|
585
|
+
m(null), x(!0);
|
|
586
|
+
},
|
|
587
|
+
children: [/* @__PURE__ */ R(se, {
|
|
588
|
+
className: "mr-1.5 h-4 w-4",
|
|
589
|
+
"aria-hidden": "true"
|
|
590
|
+
}), " Milestone"]
|
|
591
|
+
})
|
|
592
|
+
]
|
|
593
|
+
}),
|
|
594
|
+
s.description && /* @__PURE__ */ R("p", {
|
|
595
|
+
className: "whitespace-pre-wrap text-sm text-text-secondary",
|
|
596
|
+
children: s.description
|
|
597
|
+
}),
|
|
598
|
+
s.delayReason && /* @__PURE__ */ z("div", {
|
|
599
|
+
className: "rounded-card border border-border-seam bg-status-warning-bg-subtle px-4 py-3 text-sm text-status-warning-text",
|
|
600
|
+
children: [/* @__PURE__ */ R("span", {
|
|
601
|
+
className: "font-medium",
|
|
602
|
+
children: "Reason for delay: "
|
|
603
|
+
}), s.delayReason]
|
|
604
|
+
}),
|
|
605
|
+
/* @__PURE__ */ R(g, {
|
|
606
|
+
title: "Delivery details",
|
|
607
|
+
icon: /* @__PURE__ */ R(N, {}),
|
|
608
|
+
children: /* @__PURE__ */ R(E, {
|
|
609
|
+
items: A,
|
|
610
|
+
columns: 2,
|
|
611
|
+
variant: "stacked"
|
|
612
|
+
})
|
|
613
|
+
}),
|
|
614
|
+
/* @__PURE__ */ R(g, {
|
|
615
|
+
title: "Milestones",
|
|
616
|
+
icon: /* @__PURE__ */ R(ie, {}),
|
|
617
|
+
actions: /* @__PURE__ */ z("span", {
|
|
618
|
+
className: "text-xs tabular-nums text-text-muted",
|
|
619
|
+
children: [k.length, " recorded"]
|
|
620
|
+
}),
|
|
621
|
+
children: k.length === 0 ? /* @__PURE__ */ R("p", {
|
|
622
|
+
className: "text-sm text-text-secondary",
|
|
623
|
+
children: "No milestones recorded yet. Add one to publish the delivery timeline."
|
|
624
|
+
}) : /* @__PURE__ */ R("ul", {
|
|
625
|
+
className: "space-y-2.5",
|
|
626
|
+
children: k.map((e) => /* @__PURE__ */ z("li", {
|
|
627
|
+
className: "rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5",
|
|
628
|
+
children: [
|
|
629
|
+
/* @__PURE__ */ z("div", {
|
|
630
|
+
className: "flex flex-wrap items-start justify-between gap-2",
|
|
631
|
+
children: [/* @__PURE__ */ z("div", {
|
|
632
|
+
className: "min-w-0",
|
|
633
|
+
children: [/* @__PURE__ */ R("p", {
|
|
634
|
+
className: "font-medium text-text-primary",
|
|
635
|
+
children: e.name
|
|
636
|
+
}), /* @__PURE__ */ z("p", {
|
|
637
|
+
className: "text-xs text-text-muted",
|
|
638
|
+
children: [e.dueDate ? `Due ${t(e.dueDate)}` : "No due date", e.completedOn ? ` · Completed ${t(e.completedOn)}` : ""]
|
|
639
|
+
})]
|
|
640
|
+
}), /* @__PURE__ */ z("div", {
|
|
641
|
+
className: "flex items-center gap-2",
|
|
642
|
+
children: [
|
|
643
|
+
/* @__PURE__ */ R(i, { status: e.status }),
|
|
644
|
+
e.isOverdue && /* @__PURE__ */ z("span", {
|
|
645
|
+
className: "inline-flex items-center gap-1 rounded-full bg-status-error-bg-subtle px-2.5 py-0.5 text-xs font-medium text-status-error-text",
|
|
646
|
+
children: [/* @__PURE__ */ R(M, {
|
|
647
|
+
className: "size-3",
|
|
648
|
+
"aria-hidden": "true"
|
|
649
|
+
}), " Overdue"]
|
|
650
|
+
}),
|
|
651
|
+
/* @__PURE__ */ R(B, {
|
|
652
|
+
size: "sm",
|
|
653
|
+
variant: "outline",
|
|
654
|
+
"aria-label": `Edit ${e.name}`,
|
|
655
|
+
onClick: () => {
|
|
656
|
+
m(e), x(!0);
|
|
657
|
+
},
|
|
658
|
+
children: /* @__PURE__ */ R(oe, {
|
|
659
|
+
className: "h-4 w-4",
|
|
660
|
+
"aria-hidden": "true"
|
|
661
|
+
})
|
|
662
|
+
}),
|
|
663
|
+
/* @__PURE__ */ R(B, {
|
|
664
|
+
size: "sm",
|
|
665
|
+
variant: "outline",
|
|
666
|
+
"aria-label": `Delete ${e.name}`,
|
|
667
|
+
onClick: () => D(e),
|
|
668
|
+
disabled: O.isPending,
|
|
669
|
+
children: /* @__PURE__ */ R(le, {
|
|
670
|
+
className: "h-4 w-4",
|
|
671
|
+
"aria-hidden": "true"
|
|
672
|
+
})
|
|
673
|
+
})
|
|
674
|
+
]
|
|
675
|
+
})]
|
|
676
|
+
}),
|
|
677
|
+
e.description && /* @__PURE__ */ R("p", {
|
|
678
|
+
className: "mt-1.5 text-sm text-text-secondary",
|
|
679
|
+
children: e.description
|
|
680
|
+
}),
|
|
681
|
+
/* @__PURE__ */ R($, {
|
|
682
|
+
percent: e.progressPercent,
|
|
683
|
+
className: "mt-2"
|
|
684
|
+
})
|
|
685
|
+
]
|
|
686
|
+
}, e.id))
|
|
687
|
+
})
|
|
688
|
+
}),
|
|
689
|
+
(s.documentFileIds.length > 0 || s.imageFileIds.length > 0) && /* @__PURE__ */ R(g, {
|
|
690
|
+
title: "Attachments",
|
|
691
|
+
icon: /* @__PURE__ */ R(F, {}),
|
|
692
|
+
children: /* @__PURE__ */ z("div", {
|
|
693
|
+
className: "flex flex-wrap gap-2",
|
|
694
|
+
children: [s.documentFileIds.map((e, t) => /* @__PURE__ */ R(Re, {
|
|
695
|
+
fileId: e,
|
|
696
|
+
icon: /* @__PURE__ */ R(F, {
|
|
697
|
+
className: "size-4",
|
|
698
|
+
"aria-hidden": "true"
|
|
699
|
+
}),
|
|
700
|
+
label: `Document ${t + 1}`
|
|
701
|
+
}, e)), s.imageFileIds.map((e, t) => /* @__PURE__ */ R(Re, {
|
|
702
|
+
fileId: e,
|
|
703
|
+
icon: /* @__PURE__ */ R(I, {
|
|
704
|
+
className: "size-4",
|
|
705
|
+
"aria-hidden": "true"
|
|
706
|
+
}),
|
|
707
|
+
label: `Photo ${t + 1}`
|
|
708
|
+
}, e))]
|
|
709
|
+
})
|
|
710
|
+
}),
|
|
711
|
+
s.tags.length > 0 && /* @__PURE__ */ R("div", {
|
|
712
|
+
className: "flex flex-wrap gap-1.5",
|
|
713
|
+
children: s.tags.map((e) => /* @__PURE__ */ R("span", {
|
|
714
|
+
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
|
|
715
|
+
children: e
|
|
716
|
+
}, e))
|
|
717
|
+
}),
|
|
718
|
+
/* @__PURE__ */ z("div", {
|
|
719
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-2 rounded-card border border-border-seam bg-bg-sunken px-4 py-3 text-xs text-text-muted",
|
|
720
|
+
children: [
|
|
721
|
+
/* @__PURE__ */ R(w, { status: s.verification }),
|
|
722
|
+
/* @__PURE__ */ z("span", { children: [S[s.verification], " record"] }),
|
|
723
|
+
s.sourceName && /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("span", {
|
|
724
|
+
"aria-hidden": "true",
|
|
725
|
+
children: "·"
|
|
726
|
+
}), /* @__PURE__ */ z("span", { children: ["Source: ", s.sourceName] })] }),
|
|
727
|
+
s.sourceUrl && /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("span", {
|
|
728
|
+
"aria-hidden": "true",
|
|
729
|
+
children: "·"
|
|
730
|
+
}), /* @__PURE__ */ z("a", {
|
|
731
|
+
href: s.sourceUrl,
|
|
732
|
+
target: "_blank",
|
|
733
|
+
rel: "noreferrer",
|
|
734
|
+
className: "inline-flex items-center gap-1 text-text-secondary underline underline-offset-2 hover:text-text-primary",
|
|
735
|
+
children: ["Source ", /* @__PURE__ */ R(P, {
|
|
736
|
+
className: "size-3",
|
|
737
|
+
"aria-hidden": "true"
|
|
738
|
+
})]
|
|
739
|
+
})] }),
|
|
740
|
+
/* @__PURE__ */ R("span", {
|
|
741
|
+
"aria-hidden": "true",
|
|
742
|
+
children: "·"
|
|
743
|
+
}),
|
|
744
|
+
/* @__PURE__ */ R("span", { children: s.publishedAt ? `Published ${t(s.publishedAt)}` : "Not published yet" }),
|
|
745
|
+
/* @__PURE__ */ R("span", {
|
|
746
|
+
"aria-hidden": "true",
|
|
747
|
+
children: "·"
|
|
748
|
+
}),
|
|
749
|
+
/* @__PURE__ */ z("span", { children: ["Updated ", t(s.updatedAt)] })
|
|
750
|
+
]
|
|
751
|
+
})
|
|
752
|
+
]
|
|
753
|
+
})
|
|
754
|
+
})]
|
|
755
|
+
})
|
|
756
|
+
}),
|
|
757
|
+
f && s && /* @__PURE__ */ R(Ve, {
|
|
758
|
+
project: s,
|
|
759
|
+
onOpenChange: p
|
|
760
|
+
}),
|
|
761
|
+
_ && s && /* @__PURE__ */ R(He, {
|
|
762
|
+
projectId: s.id,
|
|
763
|
+
milestone: te,
|
|
764
|
+
onOpenChange: (e) => {
|
|
765
|
+
x(e), e || m(null);
|
|
766
|
+
}
|
|
767
|
+
}),
|
|
768
|
+
C && /* @__PURE__ */ R(T, {
|
|
769
|
+
open: !0,
|
|
770
|
+
onOpenChange: (e) => e ? void 0 : D(null),
|
|
771
|
+
title: `Delete ${C.name}?`,
|
|
772
|
+
description: "The milestone is removed from the published delivery timeline.",
|
|
773
|
+
confirmLabel: "Delete milestone",
|
|
774
|
+
destructive: !0,
|
|
775
|
+
onConfirm: async () => {
|
|
776
|
+
try {
|
|
777
|
+
await O.mutateAsync({
|
|
778
|
+
id: C.id,
|
|
779
|
+
projectId: C.projectId
|
|
780
|
+
}), y.success("Milestone deleted", C.name);
|
|
781
|
+
} catch (e) {
|
|
782
|
+
y.error("Could not delete the milestone", v(e));
|
|
783
|
+
}
|
|
784
|
+
D(null);
|
|
785
|
+
}
|
|
786
|
+
})
|
|
787
|
+
] });
|
|
788
|
+
}, Ve = ({ project: e, onOpenChange: t }) => {
|
|
789
|
+
let n = f(), [r, i] = j(e.status), [a, o] = j(String(e.progressPercent)), [s, c] = j(e.delayReason ?? ""), [l, u] = j(null), d = async () => {
|
|
790
|
+
u(null);
|
|
791
|
+
try {
|
|
792
|
+
await n.mutateAsync({
|
|
793
|
+
id: e.id,
|
|
794
|
+
status: r,
|
|
795
|
+
progressPercent: Q(a),
|
|
796
|
+
delayReason: s.trim() || null
|
|
797
|
+
}), y.success("Project status updated", x[r]), t(!1);
|
|
798
|
+
} catch (e) {
|
|
799
|
+
u(v(e));
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
return /* @__PURE__ */ R(pe, {
|
|
803
|
+
open: !0,
|
|
804
|
+
onOpenChange: (e) => n.isPending ? void 0 : t(e),
|
|
805
|
+
children: /* @__PURE__ */ z(me, {
|
|
806
|
+
className: "sm:max-w-md",
|
|
807
|
+
children: [
|
|
808
|
+
/* @__PURE__ */ z(_e, { children: [/* @__PURE__ */ R(ve, { children: "Update delivery status" }), /* @__PURE__ */ R(he, { children: e.name })] }),
|
|
809
|
+
/* @__PURE__ */ z("div", {
|
|
810
|
+
className: "grid gap-4 py-2",
|
|
811
|
+
children: [
|
|
812
|
+
/* @__PURE__ */ z("div", {
|
|
813
|
+
className: "grid gap-1.5",
|
|
814
|
+
children: [/* @__PURE__ */ R(H, {
|
|
815
|
+
htmlFor: "project-status",
|
|
816
|
+
children: "Status"
|
|
817
|
+
}), /* @__PURE__ */ z(U, {
|
|
818
|
+
value: r,
|
|
819
|
+
onValueChange: (e) => i(e),
|
|
820
|
+
children: [/* @__PURE__ */ R(K, {
|
|
821
|
+
id: "project-status",
|
|
822
|
+
children: /* @__PURE__ */ R(q, {})
|
|
823
|
+
}), /* @__PURE__ */ R(W, { children: Ae.map((e) => /* @__PURE__ */ R(G, {
|
|
824
|
+
value: e,
|
|
825
|
+
children: x[e]
|
|
826
|
+
}, e)) })]
|
|
827
|
+
})]
|
|
828
|
+
}),
|
|
829
|
+
/* @__PURE__ */ z("div", {
|
|
830
|
+
className: "grid gap-1.5",
|
|
831
|
+
children: [/* @__PURE__ */ R(H, {
|
|
832
|
+
htmlFor: "project-progress",
|
|
833
|
+
children: "Progress (%)"
|
|
834
|
+
}), /* @__PURE__ */ R(V, {
|
|
835
|
+
id: "project-progress",
|
|
836
|
+
type: "number",
|
|
837
|
+
min: "0",
|
|
838
|
+
max: "100",
|
|
839
|
+
value: a,
|
|
840
|
+
onChange: (e) => o(e.target.value)
|
|
841
|
+
})]
|
|
842
|
+
}),
|
|
843
|
+
/* @__PURE__ */ z("div", {
|
|
844
|
+
className: "grid gap-1.5",
|
|
845
|
+
children: [/* @__PURE__ */ R(H, {
|
|
846
|
+
htmlFor: "project-delay-reason",
|
|
847
|
+
children: "Reason for delay"
|
|
848
|
+
}), /* @__PURE__ */ R(Ee, {
|
|
849
|
+
id: "project-delay-reason",
|
|
850
|
+
rows: 3,
|
|
851
|
+
value: s,
|
|
852
|
+
onChange: (e) => c(e.target.value),
|
|
853
|
+
placeholder: "Leave blank if the project is on schedule"
|
|
854
|
+
})]
|
|
855
|
+
})
|
|
856
|
+
]
|
|
857
|
+
}),
|
|
858
|
+
l && /* @__PURE__ */ R("p", {
|
|
859
|
+
className: "text-sm text-status-error-text",
|
|
860
|
+
children: l
|
|
861
|
+
}),
|
|
862
|
+
/* @__PURE__ */ z(ge, { children: [/* @__PURE__ */ R(B, {
|
|
863
|
+
variant: "outline",
|
|
864
|
+
onClick: () => t(!1),
|
|
865
|
+
disabled: n.isPending,
|
|
866
|
+
children: "Cancel"
|
|
867
|
+
}), /* @__PURE__ */ R(B, {
|
|
868
|
+
onClick: () => {
|
|
869
|
+
d();
|
|
870
|
+
},
|
|
871
|
+
disabled: n.isPending,
|
|
872
|
+
children: "Save status"
|
|
873
|
+
})] })
|
|
874
|
+
]
|
|
875
|
+
})
|
|
876
|
+
});
|
|
877
|
+
}, He = ({ projectId: e, milestone: t, onOpenChange: r }) => {
|
|
878
|
+
let i = s(), a = ee(), [o, c] = j(t?.name ?? ""), [l, u] = j(t?.description ?? ""), [d, f] = j(X(t?.dueDate)), [p, te] = j(X(t?.completedOn)), [m, ne] = j(t?.status ?? "PENDING"), [h, g] = j(t ? String(t.progressPercent) : ""), [_, b] = j(t ? String(t.displayOrder) : ""), [x, S] = j(null), C = i.isPending || a.isPending, w = async () => {
|
|
879
|
+
S(null);
|
|
880
|
+
let n = {
|
|
881
|
+
name: o.trim(),
|
|
882
|
+
description: l.trim() || null,
|
|
883
|
+
dueDate: Z(d),
|
|
884
|
+
completedOn: Z(p),
|
|
885
|
+
status: m,
|
|
886
|
+
progressPercent: Q(h),
|
|
887
|
+
displayOrder: Q(_)
|
|
888
|
+
};
|
|
889
|
+
try {
|
|
890
|
+
t ? (await a.mutateAsync({
|
|
891
|
+
id: t.id,
|
|
892
|
+
input: n
|
|
893
|
+
}), y.success("Milestone updated", n.name)) : (await i.mutateAsync({
|
|
894
|
+
projectId: e,
|
|
895
|
+
...n
|
|
896
|
+
}), y.success("Milestone added", n.name)), r(!1);
|
|
897
|
+
} catch (e) {
|
|
898
|
+
S(v(e));
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
return /* @__PURE__ */ R(pe, {
|
|
902
|
+
open: !0,
|
|
903
|
+
onOpenChange: (e) => C ? void 0 : r(e),
|
|
904
|
+
children: /* @__PURE__ */ z(me, {
|
|
905
|
+
className: "sm:max-w-lg",
|
|
906
|
+
children: [
|
|
907
|
+
/* @__PURE__ */ z(_e, { children: [/* @__PURE__ */ R(ve, { children: t ? "Edit milestone" : "New milestone" }), /* @__PURE__ */ R(he, { children: "Milestones publish the delivery timeline citizens can hold the project to." })] }),
|
|
908
|
+
/* @__PURE__ */ z("div", {
|
|
909
|
+
className: "grid max-h-[60vh] gap-4 overflow-y-auto py-2 sm:grid-cols-2",
|
|
910
|
+
children: [
|
|
911
|
+
/* @__PURE__ */ z("div", {
|
|
912
|
+
className: "grid gap-1.5 sm:col-span-2",
|
|
913
|
+
children: [/* @__PURE__ */ R(H, {
|
|
914
|
+
htmlFor: "milestone-name",
|
|
915
|
+
children: "Name"
|
|
916
|
+
}), /* @__PURE__ */ R(V, {
|
|
917
|
+
id: "milestone-name",
|
|
918
|
+
value: o,
|
|
919
|
+
onChange: (e) => c(e.target.value),
|
|
920
|
+
placeholder: "e.g. Foundation complete"
|
|
921
|
+
})]
|
|
922
|
+
}),
|
|
923
|
+
/* @__PURE__ */ z("div", {
|
|
924
|
+
className: "grid gap-1.5 sm:col-span-2",
|
|
925
|
+
children: [/* @__PURE__ */ R(H, {
|
|
926
|
+
htmlFor: "milestone-description",
|
|
927
|
+
children: "Description"
|
|
928
|
+
}), /* @__PURE__ */ R(Ee, {
|
|
929
|
+
id: "milestone-description",
|
|
930
|
+
rows: 2,
|
|
931
|
+
value: l,
|
|
932
|
+
onChange: (e) => u(e.target.value)
|
|
933
|
+
})]
|
|
934
|
+
}),
|
|
935
|
+
/* @__PURE__ */ z("div", {
|
|
936
|
+
className: "grid gap-1.5",
|
|
937
|
+
children: [/* @__PURE__ */ R(H, {
|
|
938
|
+
htmlFor: "milestone-due",
|
|
939
|
+
children: "Due date"
|
|
940
|
+
}), /* @__PURE__ */ R(V, {
|
|
941
|
+
id: "milestone-due",
|
|
942
|
+
type: "date",
|
|
943
|
+
value: d,
|
|
944
|
+
onChange: (e) => f(e.target.value)
|
|
945
|
+
})]
|
|
946
|
+
}),
|
|
947
|
+
/* @__PURE__ */ z("div", {
|
|
948
|
+
className: "grid gap-1.5",
|
|
949
|
+
children: [/* @__PURE__ */ R(H, {
|
|
950
|
+
htmlFor: "milestone-completed",
|
|
951
|
+
children: "Completed on"
|
|
952
|
+
}), /* @__PURE__ */ R(V, {
|
|
953
|
+
id: "milestone-completed",
|
|
954
|
+
type: "date",
|
|
955
|
+
value: p,
|
|
956
|
+
onChange: (e) => te(e.target.value)
|
|
957
|
+
})]
|
|
958
|
+
}),
|
|
959
|
+
/* @__PURE__ */ z("div", {
|
|
960
|
+
className: "grid gap-1.5",
|
|
961
|
+
children: [/* @__PURE__ */ R(H, {
|
|
962
|
+
htmlFor: "milestone-status",
|
|
963
|
+
children: "Status"
|
|
964
|
+
}), /* @__PURE__ */ z(U, {
|
|
965
|
+
value: m,
|
|
966
|
+
onValueChange: (e) => ne(e),
|
|
967
|
+
children: [/* @__PURE__ */ R(K, {
|
|
968
|
+
id: "milestone-status",
|
|
969
|
+
children: /* @__PURE__ */ R(q, {})
|
|
970
|
+
}), /* @__PURE__ */ R(W, { children: Ne.map((e) => /* @__PURE__ */ R(G, {
|
|
971
|
+
value: e,
|
|
972
|
+
children: n(e)
|
|
973
|
+
}, e)) })]
|
|
974
|
+
})]
|
|
975
|
+
}),
|
|
976
|
+
/* @__PURE__ */ z("div", {
|
|
977
|
+
className: "grid gap-1.5",
|
|
978
|
+
children: [/* @__PURE__ */ R(H, {
|
|
979
|
+
htmlFor: "milestone-progress",
|
|
980
|
+
children: "Progress (%)"
|
|
981
|
+
}), /* @__PURE__ */ R(V, {
|
|
982
|
+
id: "milestone-progress",
|
|
983
|
+
type: "number",
|
|
984
|
+
min: "0",
|
|
985
|
+
max: "100",
|
|
986
|
+
value: h,
|
|
987
|
+
onChange: (e) => g(e.target.value)
|
|
988
|
+
})]
|
|
989
|
+
}),
|
|
990
|
+
/* @__PURE__ */ z("div", {
|
|
991
|
+
className: "grid gap-1.5",
|
|
992
|
+
children: [/* @__PURE__ */ R(H, {
|
|
993
|
+
htmlFor: "milestone-order",
|
|
994
|
+
children: "Display order"
|
|
995
|
+
}), /* @__PURE__ */ R(V, {
|
|
996
|
+
id: "milestone-order",
|
|
997
|
+
type: "number",
|
|
998
|
+
min: "0",
|
|
999
|
+
value: _,
|
|
1000
|
+
onChange: (e) => b(e.target.value)
|
|
1001
|
+
})]
|
|
1002
|
+
})
|
|
1003
|
+
]
|
|
1004
|
+
}),
|
|
1005
|
+
x && /* @__PURE__ */ R("p", {
|
|
1006
|
+
className: "text-sm text-status-error-text",
|
|
1007
|
+
children: x
|
|
1008
|
+
}),
|
|
1009
|
+
/* @__PURE__ */ z(ge, { children: [/* @__PURE__ */ R(B, {
|
|
1010
|
+
variant: "outline",
|
|
1011
|
+
onClick: () => r(!1),
|
|
1012
|
+
disabled: C,
|
|
1013
|
+
children: "Cancel"
|
|
1014
|
+
}), /* @__PURE__ */ R(B, {
|
|
1015
|
+
onClick: () => {
|
|
1016
|
+
w();
|
|
1017
|
+
},
|
|
1018
|
+
disabled: C || !o.trim(),
|
|
1019
|
+
children: t ? "Save milestone" : "Add milestone"
|
|
1020
|
+
})] })
|
|
1021
|
+
]
|
|
1022
|
+
})
|
|
1023
|
+
});
|
|
1024
|
+
}, Ue = ({ jurisdictionId: e, project: t, onOpenChange: r, onSaved: i }) => {
|
|
1025
|
+
let a = o(), s = d(), [c, l] = j(t?.name ?? ""), [u, ee] = j(t?.code ?? ""), [f, p] = j(t?.description ?? ""), [m, ne] = j(t?.domain ?? "INFRASTRUCTURE"), [h, g] = j(t?.department ?? ""), [_, C] = j(t?.contractorName ?? ""), [w, T] = j(t?.contractorRegistrationId ?? ""), [E, O] = j(t?.fundingSource ?? "LOCAL_REVENUE"), [k, re] = j(t?.budgetAmount == null ? "" : String(t.budgetAmount)), [A, M] = j(t?.actualCost == null ? "" : String(t.actualCost)), [N, P] = j(t?.currencyCode ?? ""), [F, ie] = j(t?.tenderReference ?? ""), [I, ae] = j(t?.tenderUrl ?? ""), [oe, se] = j(X(t?.awardedOn)), [ce, le] = j(X(t?.startDate)), [ue, de] = j(X(t?.plannedCompletionDate)), [L, fe] = j(X(t?.actualCompletionDate)), [ye, be] = j(t?.status ?? "PLANNED"), [xe, Se] = j(t ? String(t.progressPercent) : ""), [Ce, we] = j(t?.delayReason ?? ""), [Te, De] = j(t?.locationLabel ?? ""), [J, Ne] = j(t?.latitude == null ? "" : String(t.latitude)), [Y, Fe] = j(t?.longitude == null ? "" : String(t.longitude)), [Ie, Le] = j(t?.beneficiaryCount == null ? "" : String(t.beneficiaryCount)), [$, Re] = j(t?.tags ?? []), [ze, Be] = j(t?.documentFileIds ?? []), [Ve, He] = j(t?.imageFileIds ?? []), [Ue, We] = j(t?.sourceName ?? ""), [Ge, Ke] = j(t?.sourceUrl ?? ""), [qe, Je] = j(t?.verification ?? "UNVERIFIED"), [Ye, Xe] = j(!1), [Ze, Qe] = j(null), $e = a.isPending || s.isPending || Ye, et = async (e, t, n) => {
|
|
1026
|
+
Xe(!0), Qe(null);
|
|
1027
|
+
try {
|
|
1028
|
+
let r = await te(e, t);
|
|
1029
|
+
n === "document" ? Be((e) => [...e, r.id]) : He((e) => [...e, r.id]), y.success(n === "document" ? "Document attached" : "Photo attached", r.name);
|
|
1030
|
+
} catch (e) {
|
|
1031
|
+
Qe(v(e));
|
|
1032
|
+
} finally {
|
|
1033
|
+
Xe(!1);
|
|
1034
|
+
}
|
|
1035
|
+
}, tt = async () => {
|
|
1036
|
+
Qe(null);
|
|
1037
|
+
let n = {
|
|
1038
|
+
name: c.trim(),
|
|
1039
|
+
code: u.trim() || null,
|
|
1040
|
+
description: f.trim() || null,
|
|
1041
|
+
domain: m,
|
|
1042
|
+
department: h.trim() || null,
|
|
1043
|
+
contractorName: _.trim() || null,
|
|
1044
|
+
contractorRegistrationId: w.trim() || null,
|
|
1045
|
+
fundingSource: E,
|
|
1046
|
+
budgetAmount: Q(k),
|
|
1047
|
+
actualCost: Q(A),
|
|
1048
|
+
currencyCode: N.trim().toUpperCase() || null,
|
|
1049
|
+
tenderReference: F.trim() || null,
|
|
1050
|
+
tenderUrl: I.trim() || null,
|
|
1051
|
+
awardedOn: Z(oe),
|
|
1052
|
+
startDate: Z(ce),
|
|
1053
|
+
plannedCompletionDate: Z(ue),
|
|
1054
|
+
actualCompletionDate: Z(L),
|
|
1055
|
+
status: ye,
|
|
1056
|
+
progressPercent: Q(xe),
|
|
1057
|
+
delayReason: Ce.trim() || null,
|
|
1058
|
+
locationLabel: Te.trim() || null,
|
|
1059
|
+
latitude: Q(J),
|
|
1060
|
+
longitude: Q(Y),
|
|
1061
|
+
beneficiaryCount: Q(Ie),
|
|
1062
|
+
tags: $,
|
|
1063
|
+
documentFileIds: ze,
|
|
1064
|
+
imageFileIds: Ve,
|
|
1065
|
+
sourceName: Ue.trim() || null,
|
|
1066
|
+
sourceUrl: Ge.trim() || null,
|
|
1067
|
+
verification: qe
|
|
1068
|
+
};
|
|
1069
|
+
try {
|
|
1070
|
+
let o = t ? await s.mutateAsync({
|
|
1071
|
+
id: t.id,
|
|
1072
|
+
input: n
|
|
1073
|
+
}) : await a.mutateAsync({
|
|
1074
|
+
jurisdictionId: e,
|
|
1075
|
+
...n
|
|
1076
|
+
});
|
|
1077
|
+
y.success(t ? "Project updated" : "Project created", o.name), i(o), r(!1);
|
|
1078
|
+
} catch (e) {
|
|
1079
|
+
Qe(v(e));
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
1082
|
+
return /* @__PURE__ */ R(pe, {
|
|
1083
|
+
open: !0,
|
|
1084
|
+
onOpenChange: (e) => $e ? void 0 : r(e),
|
|
1085
|
+
children: /* @__PURE__ */ z(me, {
|
|
1086
|
+
className: "sm:max-w-3xl",
|
|
1087
|
+
children: [
|
|
1088
|
+
/* @__PURE__ */ z(_e, { children: [/* @__PURE__ */ R(ve, { children: t ? "Edit project" : "New project" }), /* @__PURE__ */ R(he, { children: "Publish a public works or development project, its money, its timeline and its provenance." })] }),
|
|
1089
|
+
/* @__PURE__ */ z("div", {
|
|
1090
|
+
className: "grid max-h-[60vh] gap-4 overflow-y-auto py-2 sm:grid-cols-2",
|
|
1091
|
+
children: [
|
|
1092
|
+
/* @__PURE__ */ z("div", {
|
|
1093
|
+
className: "grid gap-1.5 sm:col-span-2",
|
|
1094
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1095
|
+
htmlFor: "project-name",
|
|
1096
|
+
children: "Name"
|
|
1097
|
+
}), /* @__PURE__ */ R(V, {
|
|
1098
|
+
id: "project-name",
|
|
1099
|
+
value: c,
|
|
1100
|
+
onChange: (e) => l(e.target.value)
|
|
1101
|
+
})]
|
|
1102
|
+
}),
|
|
1103
|
+
/* @__PURE__ */ z("div", {
|
|
1104
|
+
className: "grid gap-1.5",
|
|
1105
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1106
|
+
htmlFor: "project-code",
|
|
1107
|
+
children: "Project code"
|
|
1108
|
+
}), /* @__PURE__ */ R(V, {
|
|
1109
|
+
id: "project-code",
|
|
1110
|
+
value: u,
|
|
1111
|
+
onChange: (e) => ee(e.target.value)
|
|
1112
|
+
})]
|
|
1113
|
+
}),
|
|
1114
|
+
/* @__PURE__ */ z("div", {
|
|
1115
|
+
className: "grid gap-1.5",
|
|
1116
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1117
|
+
htmlFor: "project-domain",
|
|
1118
|
+
children: "Sector"
|
|
1119
|
+
}), /* @__PURE__ */ z(U, {
|
|
1120
|
+
value: m,
|
|
1121
|
+
onValueChange: (e) => ne(e),
|
|
1122
|
+
children: [/* @__PURE__ */ R(K, {
|
|
1123
|
+
id: "project-domain",
|
|
1124
|
+
children: /* @__PURE__ */ R(q, {})
|
|
1125
|
+
}), /* @__PURE__ */ R(W, { children: Me.map((e) => /* @__PURE__ */ R(G, {
|
|
1126
|
+
value: e,
|
|
1127
|
+
children: b[e]
|
|
1128
|
+
}, e)) })]
|
|
1129
|
+
})]
|
|
1130
|
+
}),
|
|
1131
|
+
/* @__PURE__ */ z("div", {
|
|
1132
|
+
className: "grid gap-1.5 sm:col-span-2",
|
|
1133
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1134
|
+
htmlFor: "project-description",
|
|
1135
|
+
children: "Description"
|
|
1136
|
+
}), /* @__PURE__ */ R(Ee, {
|
|
1137
|
+
id: "project-description",
|
|
1138
|
+
rows: 3,
|
|
1139
|
+
value: f,
|
|
1140
|
+
onChange: (e) => p(e.target.value)
|
|
1141
|
+
})]
|
|
1142
|
+
}),
|
|
1143
|
+
/* @__PURE__ */ z("div", {
|
|
1144
|
+
className: "grid gap-1.5",
|
|
1145
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1146
|
+
htmlFor: "project-department",
|
|
1147
|
+
children: "Department"
|
|
1148
|
+
}), /* @__PURE__ */ R(V, {
|
|
1149
|
+
id: "project-department",
|
|
1150
|
+
value: h,
|
|
1151
|
+
onChange: (e) => g(e.target.value)
|
|
1152
|
+
})]
|
|
1153
|
+
}),
|
|
1154
|
+
/* @__PURE__ */ z("div", {
|
|
1155
|
+
className: "grid gap-1.5",
|
|
1156
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1157
|
+
htmlFor: "project-funding",
|
|
1158
|
+
children: "Funding source"
|
|
1159
|
+
}), /* @__PURE__ */ z(U, {
|
|
1160
|
+
value: E,
|
|
1161
|
+
onValueChange: (e) => O(e),
|
|
1162
|
+
children: [/* @__PURE__ */ R(K, {
|
|
1163
|
+
id: "project-funding",
|
|
1164
|
+
children: /* @__PURE__ */ R(q, {})
|
|
1165
|
+
}), /* @__PURE__ */ R(W, { children: je.map((e) => /* @__PURE__ */ R(G, {
|
|
1166
|
+
value: e,
|
|
1167
|
+
children: n(e)
|
|
1168
|
+
}, e)) })]
|
|
1169
|
+
})]
|
|
1170
|
+
}),
|
|
1171
|
+
/* @__PURE__ */ z("div", {
|
|
1172
|
+
className: "grid gap-1.5",
|
|
1173
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1174
|
+
htmlFor: "project-contractor",
|
|
1175
|
+
children: "Contractor"
|
|
1176
|
+
}), /* @__PURE__ */ R(V, {
|
|
1177
|
+
id: "project-contractor",
|
|
1178
|
+
value: _,
|
|
1179
|
+
onChange: (e) => C(e.target.value)
|
|
1180
|
+
})]
|
|
1181
|
+
}),
|
|
1182
|
+
/* @__PURE__ */ z("div", {
|
|
1183
|
+
className: "grid gap-1.5",
|
|
1184
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1185
|
+
htmlFor: "project-contractor-reg",
|
|
1186
|
+
children: "Contractor registration id"
|
|
1187
|
+
}), /* @__PURE__ */ R(V, {
|
|
1188
|
+
id: "project-contractor-reg",
|
|
1189
|
+
value: w,
|
|
1190
|
+
onChange: (e) => T(e.target.value)
|
|
1191
|
+
})]
|
|
1192
|
+
}),
|
|
1193
|
+
/* @__PURE__ */ z("div", {
|
|
1194
|
+
className: "grid gap-1.5",
|
|
1195
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1196
|
+
htmlFor: "project-budget",
|
|
1197
|
+
children: "Budget amount"
|
|
1198
|
+
}), /* @__PURE__ */ R(V, {
|
|
1199
|
+
id: "project-budget",
|
|
1200
|
+
type: "number",
|
|
1201
|
+
step: "0.01",
|
|
1202
|
+
value: k,
|
|
1203
|
+
onChange: (e) => re(e.target.value)
|
|
1204
|
+
})]
|
|
1205
|
+
}),
|
|
1206
|
+
/* @__PURE__ */ z("div", {
|
|
1207
|
+
className: "grid gap-1.5",
|
|
1208
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1209
|
+
htmlFor: "project-actual",
|
|
1210
|
+
children: "Actual cost"
|
|
1211
|
+
}), /* @__PURE__ */ R(V, {
|
|
1212
|
+
id: "project-actual",
|
|
1213
|
+
type: "number",
|
|
1214
|
+
step: "0.01",
|
|
1215
|
+
value: A,
|
|
1216
|
+
onChange: (e) => M(e.target.value),
|
|
1217
|
+
placeholder: "Leave blank until reported"
|
|
1218
|
+
})]
|
|
1219
|
+
}),
|
|
1220
|
+
/* @__PURE__ */ z("div", {
|
|
1221
|
+
className: "grid gap-1.5",
|
|
1222
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1223
|
+
htmlFor: "project-currency",
|
|
1224
|
+
children: "Currency (ISO 4217)"
|
|
1225
|
+
}), /* @__PURE__ */ R(V, {
|
|
1226
|
+
id: "project-currency",
|
|
1227
|
+
value: N,
|
|
1228
|
+
maxLength: 3,
|
|
1229
|
+
onChange: (e) => P(e.target.value.toUpperCase())
|
|
1230
|
+
})]
|
|
1231
|
+
}),
|
|
1232
|
+
/* @__PURE__ */ z("div", {
|
|
1233
|
+
className: "grid gap-1.5",
|
|
1234
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1235
|
+
htmlFor: "project-status-field",
|
|
1236
|
+
children: "Status"
|
|
1237
|
+
}), /* @__PURE__ */ z(U, {
|
|
1238
|
+
value: ye,
|
|
1239
|
+
onValueChange: (e) => be(e),
|
|
1240
|
+
children: [/* @__PURE__ */ R(K, {
|
|
1241
|
+
id: "project-status-field",
|
|
1242
|
+
children: /* @__PURE__ */ R(q, {})
|
|
1243
|
+
}), /* @__PURE__ */ R(W, { children: Ae.map((e) => /* @__PURE__ */ R(G, {
|
|
1244
|
+
value: e,
|
|
1245
|
+
children: x[e]
|
|
1246
|
+
}, e)) })]
|
|
1247
|
+
})]
|
|
1248
|
+
}),
|
|
1249
|
+
/* @__PURE__ */ z("div", {
|
|
1250
|
+
className: "grid gap-1.5",
|
|
1251
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1252
|
+
htmlFor: "project-progress-field",
|
|
1253
|
+
children: "Progress (%)"
|
|
1254
|
+
}), /* @__PURE__ */ R(V, {
|
|
1255
|
+
id: "project-progress-field",
|
|
1256
|
+
type: "number",
|
|
1257
|
+
min: "0",
|
|
1258
|
+
max: "100",
|
|
1259
|
+
value: xe,
|
|
1260
|
+
onChange: (e) => Se(e.target.value)
|
|
1261
|
+
})]
|
|
1262
|
+
}),
|
|
1263
|
+
/* @__PURE__ */ z("div", {
|
|
1264
|
+
className: "grid gap-1.5",
|
|
1265
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1266
|
+
htmlFor: "project-tender-ref",
|
|
1267
|
+
children: "Tender reference"
|
|
1268
|
+
}), /* @__PURE__ */ R(V, {
|
|
1269
|
+
id: "project-tender-ref",
|
|
1270
|
+
value: F,
|
|
1271
|
+
onChange: (e) => ie(e.target.value)
|
|
1272
|
+
})]
|
|
1273
|
+
}),
|
|
1274
|
+
/* @__PURE__ */ z("div", {
|
|
1275
|
+
className: "grid gap-1.5",
|
|
1276
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1277
|
+
htmlFor: "project-tender-url",
|
|
1278
|
+
children: "Tender URL"
|
|
1279
|
+
}), /* @__PURE__ */ R(V, {
|
|
1280
|
+
id: "project-tender-url",
|
|
1281
|
+
value: I,
|
|
1282
|
+
onChange: (e) => ae(e.target.value),
|
|
1283
|
+
placeholder: "https://"
|
|
1284
|
+
})]
|
|
1285
|
+
}),
|
|
1286
|
+
/* @__PURE__ */ z("div", {
|
|
1287
|
+
className: "grid gap-1.5",
|
|
1288
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1289
|
+
htmlFor: "project-awarded",
|
|
1290
|
+
children: "Awarded on"
|
|
1291
|
+
}), /* @__PURE__ */ R(V, {
|
|
1292
|
+
id: "project-awarded",
|
|
1293
|
+
type: "date",
|
|
1294
|
+
value: oe,
|
|
1295
|
+
onChange: (e) => se(e.target.value)
|
|
1296
|
+
})]
|
|
1297
|
+
}),
|
|
1298
|
+
/* @__PURE__ */ z("div", {
|
|
1299
|
+
className: "grid gap-1.5",
|
|
1300
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1301
|
+
htmlFor: "project-start",
|
|
1302
|
+
children: "Start date"
|
|
1303
|
+
}), /* @__PURE__ */ R(V, {
|
|
1304
|
+
id: "project-start",
|
|
1305
|
+
type: "date",
|
|
1306
|
+
value: ce,
|
|
1307
|
+
onChange: (e) => le(e.target.value)
|
|
1308
|
+
})]
|
|
1309
|
+
}),
|
|
1310
|
+
/* @__PURE__ */ z("div", {
|
|
1311
|
+
className: "grid gap-1.5",
|
|
1312
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1313
|
+
htmlFor: "project-planned",
|
|
1314
|
+
children: "Planned completion"
|
|
1315
|
+
}), /* @__PURE__ */ R(V, {
|
|
1316
|
+
id: "project-planned",
|
|
1317
|
+
type: "date",
|
|
1318
|
+
value: ue,
|
|
1319
|
+
onChange: (e) => de(e.target.value)
|
|
1320
|
+
})]
|
|
1321
|
+
}),
|
|
1322
|
+
/* @__PURE__ */ z("div", {
|
|
1323
|
+
className: "grid gap-1.5",
|
|
1324
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1325
|
+
htmlFor: "project-actual-completion",
|
|
1326
|
+
children: "Actual completion"
|
|
1327
|
+
}), /* @__PURE__ */ R(V, {
|
|
1328
|
+
id: "project-actual-completion",
|
|
1329
|
+
type: "date",
|
|
1330
|
+
value: L,
|
|
1331
|
+
onChange: (e) => fe(e.target.value)
|
|
1332
|
+
})]
|
|
1333
|
+
}),
|
|
1334
|
+
/* @__PURE__ */ z("div", {
|
|
1335
|
+
className: "grid gap-1.5 sm:col-span-2",
|
|
1336
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1337
|
+
htmlFor: "project-delay",
|
|
1338
|
+
children: "Reason for delay"
|
|
1339
|
+
}), /* @__PURE__ */ R(Ee, {
|
|
1340
|
+
id: "project-delay",
|
|
1341
|
+
rows: 2,
|
|
1342
|
+
value: Ce,
|
|
1343
|
+
onChange: (e) => we(e.target.value),
|
|
1344
|
+
placeholder: "Leave blank if the project is on schedule"
|
|
1345
|
+
})]
|
|
1346
|
+
}),
|
|
1347
|
+
/* @__PURE__ */ z("div", {
|
|
1348
|
+
className: "grid gap-1.5",
|
|
1349
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1350
|
+
htmlFor: "project-location",
|
|
1351
|
+
children: "Location label"
|
|
1352
|
+
}), /* @__PURE__ */ R(V, {
|
|
1353
|
+
id: "project-location",
|
|
1354
|
+
value: Te,
|
|
1355
|
+
onChange: (e) => De(e.target.value)
|
|
1356
|
+
})]
|
|
1357
|
+
}),
|
|
1358
|
+
/* @__PURE__ */ z("div", {
|
|
1359
|
+
className: "grid gap-1.5",
|
|
1360
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1361
|
+
htmlFor: "project-beneficiaries",
|
|
1362
|
+
children: "Beneficiaries"
|
|
1363
|
+
}), /* @__PURE__ */ R(V, {
|
|
1364
|
+
id: "project-beneficiaries",
|
|
1365
|
+
type: "number",
|
|
1366
|
+
min: "0",
|
|
1367
|
+
value: Ie,
|
|
1368
|
+
onChange: (e) => Le(e.target.value)
|
|
1369
|
+
})]
|
|
1370
|
+
}),
|
|
1371
|
+
/* @__PURE__ */ z("div", {
|
|
1372
|
+
className: "grid gap-1.5",
|
|
1373
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1374
|
+
htmlFor: "project-lat",
|
|
1375
|
+
children: "Latitude"
|
|
1376
|
+
}), /* @__PURE__ */ R(V, {
|
|
1377
|
+
id: "project-lat",
|
|
1378
|
+
type: "number",
|
|
1379
|
+
step: "0.000001",
|
|
1380
|
+
value: J,
|
|
1381
|
+
onChange: (e) => Ne(e.target.value)
|
|
1382
|
+
})]
|
|
1383
|
+
}),
|
|
1384
|
+
/* @__PURE__ */ z("div", {
|
|
1385
|
+
className: "grid gap-1.5",
|
|
1386
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1387
|
+
htmlFor: "project-lng",
|
|
1388
|
+
children: "Longitude"
|
|
1389
|
+
}), /* @__PURE__ */ R(V, {
|
|
1390
|
+
id: "project-lng",
|
|
1391
|
+
type: "number",
|
|
1392
|
+
step: "0.000001",
|
|
1393
|
+
value: Y,
|
|
1394
|
+
onChange: (e) => Fe(e.target.value)
|
|
1395
|
+
})]
|
|
1396
|
+
}),
|
|
1397
|
+
/* @__PURE__ */ z("div", {
|
|
1398
|
+
className: "grid gap-1.5",
|
|
1399
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1400
|
+
htmlFor: "project-source-name",
|
|
1401
|
+
children: "Source name"
|
|
1402
|
+
}), /* @__PURE__ */ R(V, {
|
|
1403
|
+
id: "project-source-name",
|
|
1404
|
+
value: Ue,
|
|
1405
|
+
onChange: (e) => We(e.target.value)
|
|
1406
|
+
})]
|
|
1407
|
+
}),
|
|
1408
|
+
/* @__PURE__ */ z("div", {
|
|
1409
|
+
className: "grid gap-1.5",
|
|
1410
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1411
|
+
htmlFor: "project-source-url",
|
|
1412
|
+
children: "Source URL"
|
|
1413
|
+
}), /* @__PURE__ */ R(V, {
|
|
1414
|
+
id: "project-source-url",
|
|
1415
|
+
value: Ge,
|
|
1416
|
+
onChange: (e) => Ke(e.target.value),
|
|
1417
|
+
placeholder: "https://"
|
|
1418
|
+
})]
|
|
1419
|
+
}),
|
|
1420
|
+
/* @__PURE__ */ z("div", {
|
|
1421
|
+
className: "grid gap-1.5",
|
|
1422
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1423
|
+
htmlFor: "project-verification",
|
|
1424
|
+
children: "Provenance"
|
|
1425
|
+
}), /* @__PURE__ */ z(U, {
|
|
1426
|
+
value: qe,
|
|
1427
|
+
onValueChange: (e) => Je(e),
|
|
1428
|
+
children: [/* @__PURE__ */ R(K, {
|
|
1429
|
+
id: "project-verification",
|
|
1430
|
+
children: /* @__PURE__ */ R(q, {})
|
|
1431
|
+
}), /* @__PURE__ */ R(W, { children: Pe.map((e) => /* @__PURE__ */ R(G, {
|
|
1432
|
+
value: e,
|
|
1433
|
+
children: S[e]
|
|
1434
|
+
}, e)) })]
|
|
1435
|
+
})]
|
|
1436
|
+
}),
|
|
1437
|
+
/* @__PURE__ */ z("div", {
|
|
1438
|
+
className: "grid gap-1.5 sm:col-span-2",
|
|
1439
|
+
children: [/* @__PURE__ */ R(H, {
|
|
1440
|
+
htmlFor: "project-tags",
|
|
1441
|
+
children: "Tags"
|
|
1442
|
+
}), /* @__PURE__ */ R(D, {
|
|
1443
|
+
id: "project-tags",
|
|
1444
|
+
value: $,
|
|
1445
|
+
onChange: Re
|
|
1446
|
+
})]
|
|
1447
|
+
}),
|
|
1448
|
+
/* @__PURE__ */ z("div", {
|
|
1449
|
+
className: "grid gap-1.5",
|
|
1450
|
+
children: [
|
|
1451
|
+
/* @__PURE__ */ R(H, {
|
|
1452
|
+
htmlFor: "project-document",
|
|
1453
|
+
children: "Attach document"
|
|
1454
|
+
}),
|
|
1455
|
+
/* @__PURE__ */ R(V, {
|
|
1456
|
+
id: "project-document",
|
|
1457
|
+
type: "file",
|
|
1458
|
+
disabled: Ye,
|
|
1459
|
+
onChange: (e) => {
|
|
1460
|
+
let t = e.target.files?.[0];
|
|
1461
|
+
t && et(t, Oe, "document");
|
|
1462
|
+
}
|
|
1463
|
+
}),
|
|
1464
|
+
/* @__PURE__ */ z("p", {
|
|
1465
|
+
className: "text-xs text-text-muted",
|
|
1466
|
+
children: [ze.length, " attached"]
|
|
1467
|
+
})
|
|
1468
|
+
]
|
|
1469
|
+
}),
|
|
1470
|
+
/* @__PURE__ */ z("div", {
|
|
1471
|
+
className: "grid gap-1.5",
|
|
1472
|
+
children: [
|
|
1473
|
+
/* @__PURE__ */ R(H, {
|
|
1474
|
+
htmlFor: "project-image",
|
|
1475
|
+
children: "Attach photo"
|
|
1476
|
+
}),
|
|
1477
|
+
/* @__PURE__ */ R(V, {
|
|
1478
|
+
id: "project-image",
|
|
1479
|
+
type: "file",
|
|
1480
|
+
accept: "image/*",
|
|
1481
|
+
disabled: Ye,
|
|
1482
|
+
onChange: (e) => {
|
|
1483
|
+
let t = e.target.files?.[0];
|
|
1484
|
+
t && et(t, ke, "image");
|
|
1485
|
+
}
|
|
1486
|
+
}),
|
|
1487
|
+
/* @__PURE__ */ z("p", {
|
|
1488
|
+
className: "text-xs text-text-muted",
|
|
1489
|
+
children: [Ve.length, " attached"]
|
|
1490
|
+
})
|
|
1491
|
+
]
|
|
1492
|
+
})
|
|
1493
|
+
]
|
|
1494
|
+
}),
|
|
1495
|
+
Ze && /* @__PURE__ */ R("p", {
|
|
1496
|
+
className: "text-sm text-status-error-text",
|
|
1497
|
+
children: Ze
|
|
1498
|
+
}),
|
|
1499
|
+
/* @__PURE__ */ z(ge, { children: [/* @__PURE__ */ R(B, {
|
|
1500
|
+
variant: "outline",
|
|
1501
|
+
onClick: () => r(!1),
|
|
1502
|
+
disabled: $e,
|
|
1503
|
+
children: "Cancel"
|
|
1504
|
+
}), /* @__PURE__ */ R(B, {
|
|
1505
|
+
onClick: () => {
|
|
1506
|
+
tt();
|
|
1507
|
+
},
|
|
1508
|
+
disabled: $e || !c.trim(),
|
|
1509
|
+
children: t ? "Save project" : "Create project"
|
|
1510
|
+
})] })
|
|
1511
|
+
]
|
|
1512
|
+
})
|
|
1513
|
+
});
|
|
1514
|
+
};
|
|
1515
|
+
//#endregion
|
|
1516
|
+
export { ze as ProjectsPage };
|
|
1517
|
+
|
|
1518
|
+
//# sourceMappingURL=ProjectsPage.js.map
|