@burdenoff/microfe-govcitizenhub 2026.730.1 → 2026.730.3
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/components/DocumentUploadField.d.ts.map +1 -1
- package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
- package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts +9 -1
- package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts.map +1 -1
- package/dist/govcitizenhub/hooks/useIntelligenceApi.js +95 -86
- package/dist/govcitizenhub/hooks/useIntelligenceApi.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js +168 -160
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js +2 -1
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts.map +1 -1
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js.map +1 -1
- package/dist/govcitizenhub/types/intelligence.d.ts +20 -0
- package/dist/govcitizenhub/types/intelligence.d.ts.map +1 -1
- package/dist/govcitizenhub/types/intelligence.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JurisdictionLayout.js","names":[],"sources":["../../../../src/govcitizenhub/pages/intelligence/JurisdictionLayout.tsx"],"sourcesContent":["/**\n * JurisdictionLayout — shared chrome for every Community Intelligence profile tab.\n * @module govcitizenhub/pages/intelligence\n *\n * Owns the parts every `/intelligence/:jurisdictionId/*` page shares:\n * - the ancestor breadcrumb (Community Intelligence → parent → this region),\n * - the jurisdiction name + admin-level chip + publication/verification state,\n * - the Follow / Unfollow control (a `self` mutation — the actor comes from the\n * gateway, never from a client-supplied id),\n * - the tab strip across the 13 profile surfaces.\n *\n * It reads `govJurisdictionOverview` once for the whole tab set; the active tab\n * is derived from the current location, so a page just wraps its body in\n * <JurisdictionLayout> without declaring which tab it is.\n *\n * Every value rendered here comes from the API. Nothing is placeholder data.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { useLocation, useParams } from 'react-router-dom';\nimport { BellOff, BellRing, Users } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\n\nimport { PageLayout, type Breadcrumb } from '../../components/PageLayout';\nimport { FilterTabs, type FilterOption } from '../../components/FilterTabs';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport {\n useGovFollowJurisdiction,\n useGovJurisdictionOverview,\n useGovUnfollowJurisdiction,\n} from '../../hooks';\nimport { useGovCitizenHub } from '../../context';\nimport { notify, describeError } from '../../lib/toast';\nimport { formatNumber } from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport { GOV_VERIFICATION_LABELS, type GovVerificationStatus } from '../../types';\n\n/** The profile-root tab has no path segment; this sentinel stands in for it. */\nconst PROFILE_TAB = 'profile';\n\n/** The 13 jurisdiction profile surfaces, in route order. */\nexport const JURISDICTION_TABS: readonly FilterOption<string>[] = [\n { value: PROFILE_TAB, label: 'Profile' },\n { value: 'governance', label: 'Governance' },\n { value: 'budget', label: 'Budget' },\n { value: 'projects', label: 'Projects' },\n { value: 'indicators', label: 'Indicators' },\n { value: 'benchmark', label: 'Benchmark' },\n { value: 'services', label: 'Services' },\n { value: 'assets', label: 'Public assets' },\n { value: 'elections', label: 'Elections' },\n { value: 'consultations', label: 'Consultations' },\n { value: 'open-data', label: 'Open data' },\n { value: 'timeline', label: 'Timeline' },\n { value: 'corrections', label: 'Corrections' },\n];\n\nconst TAB_SEGMENTS = new Set(JURISDICTION_TABS.map((tab) => tab.value));\n\nconst verificationTone: Record<GovVerificationStatus, string> = {\n UNVERIFIED: 'bg-bg-sunken text-text-secondary',\n OFFICIAL: 'bg-status-success-bg-subtle text-status-success-text',\n COMMUNITY_VERIFIED: 'bg-[var(--color-accent-soft)] text-action-primary-text',\n DISPUTED: 'bg-status-error-bg-subtle text-status-error-text',\n};\n\n/** Provenance grade chip — shared by every Community Intelligence surface. */\nexport const VerificationChip: FC<{ status: GovVerificationStatus; className?: string }> = ({\n status,\n className,\n}) => (\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium',\n verificationTone[status],\n className\n )}\n >\n {GOV_VERIFICATION_LABELS[status]}\n </span>\n);\n\nexport interface JurisdictionLayoutProps {\n children: ReactNode;\n /** Page-specific header actions, rendered before the Follow control. */\n actions?: ReactNode;\n /** Caption under the region name. Defaults to the admin level + official code. */\n description?: string;\n}\n\nexport const JurisdictionLayout: FC<JurisdictionLayoutProps> = ({\n children,\n actions,\n description,\n}) => {\n const { jurisdictionId } = useParams<{ jurisdictionId: string }>();\n const { pathname } = useLocation();\n const { navigateTo } = useGovCitizenHub();\n\n const { data: overview, isLoading, isError, refetch } = useGovJurisdictionOverview(jurisdictionId);\n const followJurisdiction = useGovFollowJurisdiction();\n const unfollowJurisdiction = useGovUnfollowJurisdiction();\n\n const lastSegment = pathname.split('/').filter(Boolean).pop() ?? '';\n const activeTab = TAB_SEGMENTS.has(lastSegment) ? lastSegment : PROFILE_TAB;\n\n const goToTab = (tab: string) => {\n if (!jurisdictionId) return;\n navigateTo(\n tab === PROFILE_TAB\n ? `intelligence/${jurisdictionId}`\n : `intelligence/${jurisdictionId}/${tab}`\n );\n };\n\n if (isLoading) {\n return (\n <PageLayout\n title=\"Jurisdiction\"\n back={{ label: 'Community Intelligence', onClick: () => navigateTo('intelligence') }}\n >\n <LoadingView label=\"Loading jurisdiction…\" />\n </PageLayout>\n );\n }\n\n if (isError || !overview) {\n return (\n <PageLayout\n title=\"Jurisdiction\"\n back={{ label: 'Community Intelligence', onClick: () => navigateTo('intelligence') }}\n >\n <ErrorView\n message=\"We couldn't load this jurisdiction profile.\"\n onRetry={() => {\n void refetch();\n }}\n />\n </PageLayout>\n );\n }\n\n const { jurisdiction, adminLevel, parent } = overview;\n const following = overview.isFollowedByMe;\n const followBusy = followJurisdiction.isPending || unfollowJurisdiction.isPending;\n\n const toggleFollow = async () => {\n if (!jurisdictionId) return;\n try {\n if (following) {\n await unfollowJurisdiction.mutateAsync(jurisdictionId);\n notify.success('Unfollowed', `You will no longer get updates for ${jurisdiction.name}.`);\n } else {\n await followJurisdiction.mutateAsync({ jurisdictionId });\n notify.success('Following', `You will get updates for ${jurisdiction.name}.`);\n }\n } catch (err) {\n notify.error('Could not update your follow preference', describeError(err));\n }\n };\n\n const breadcrumbs: Breadcrumb[] = [\n { label: 'Community Intelligence', onClick: () => navigateTo('intelligence') },\n ...(parent\n ? [{ label: parent.name, onClick: () => navigateTo(`intelligence/${parent.id}`) }]\n : []),\n { label: jurisdiction.name },\n ];\n\n const caption =\n description ??\n [adminLevel?.name, jurisdiction.officialCode ? `Code ${jurisdiction.officialCode}` : null]\n .filter(Boolean)\n .join(' · ');\n\n return (\n <PageLayout\n breadcrumbs={breadcrumbs}\n title={\n <span className=\"flex flex-wrap items-center gap-x-3 gap-y-2\">\n <span className=\"text-text-primary\">{jurisdiction.name}</span>\n {jurisdiction.localName && (\n <span className=\"text-lg font-normal text-text-secondary\">\n {jurisdiction.localName}\n </span>\n )}\n {adminLevel && (\n <span className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {adminLevel.name}\n </span>\n )}\n <VerificationChip status={jurisdiction.verification} />\n </span>\n }\n description={caption || undefined}\n actions={\n <div className=\"flex flex-wrap items-center gap-2\">\n {actions}\n <span className=\"inline-flex items-center gap-1.5 text-sm text-text-muted tabular-nums\">\n <Users className=\"size-4\" aria-hidden=\"true\" />\n {formatNumber(overview.followerCount)}\n </span>\n <Button\n variant={following ? 'outline' : 'default'}\n onClick={() => {\n void toggleFollow();\n }}\n disabled={followBusy}\n >\n {following ? (\n <>\n <BellOff className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" /> Unfollow\n </>\n ) : (\n <>\n <BellRing className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" /> Follow\n </>\n )}\n </Button>\n </div>\n }\n >\n <div className=\"mb-6\">\n <FilterTabs\n variant=\"underline\"\n options={[...JURISDICTION_TABS]}\n value={activeTab}\n onChange={goToTab}\n className=\"w-full\"\n />\n </div>\n {children}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,IAAM,IAAc,WAGP,IAAqD;CAChE;EAAE,OAAO;EAAa,OAAO;CAAU;CACvC;EAAE,OAAO;EAAc,OAAO;CAAa;CAC3C;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAY,OAAO;CAAW;CACvC;EAAE,OAAO;EAAc,OAAO;CAAa;CAC3C;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAY,OAAO;CAAW;CACvC;EAAE,OAAO;EAAU,OAAO;CAAgB;CAC1C;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAiB,OAAO;CAAgB;CACjD;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAY,OAAO;CAAW;CACvC;EAAE,OAAO;EAAe,OAAO;CAAc;AAC/C,GAEM,IAAe,IAAI,IAAI,EAAkB,KAAK,MAAQ,EAAI,KAAK,CAAC,GAEhE,IAA0D;CAC9D,YAAY;CACZ,UAAU;CACV,oBAAoB;CACpB,UAAU;AACZ,GAGa,KAA+E,EAC1F,WACA,mBAEA,kBAAC,QAAD;CACE,WAAW,EAC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AAiB;IAC9B,OAAO;IACP,UAAU;IACV,WAAU;GACX,CAAA;EACE,CAAA,GACJ,CACS;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"JurisdictionLayout.js","names":[],"sources":["../../../../src/govcitizenhub/pages/intelligence/JurisdictionLayout.tsx"],"sourcesContent":["/**\n * JurisdictionLayout — shared chrome for every Community Intelligence profile tab.\n * @module govcitizenhub/pages/intelligence\n *\n * Owns the parts every `/intelligence/:jurisdictionId/*` page shares:\n * - the ancestor breadcrumb (Community Intelligence → parent → this region),\n * - the jurisdiction name + admin-level chip + publication/verification state,\n * - the Follow / Unfollow control (a `self` mutation — the actor comes from the\n * gateway, never from a client-supplied id),\n * - the tab strip across the 13 profile surfaces.\n *\n * It reads `govJurisdictionOverview` once for the whole tab set; the active tab\n * is derived from the current location, so a page just wraps its body in\n * <JurisdictionLayout> without declaring which tab it is.\n *\n * Every value rendered here comes from the API. Nothing is placeholder data.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { useLocation, useParams } from 'react-router-dom';\nimport { BellOff, BellRing, Users } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\n\nimport { PageLayout, type Breadcrumb } from '../../components/PageLayout';\nimport { FilterTabs, type FilterOption } from '../../components/FilterTabs';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport {\n useGovFollowJurisdiction,\n useGovJurisdictionOverview,\n useGovUnfollowJurisdiction,\n} from '../../hooks';\nimport { useGovCitizenHub } from '../../context';\nimport { notify, describeError } from '../../lib/toast';\nimport { formatNumber } from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport { GOV_VERIFICATION_LABELS, type GovVerificationStatus } from '../../types';\n\n/** The profile-root tab has no path segment; this sentinel stands in for it. */\nconst PROFILE_TAB = 'profile';\n\n/** The 13 jurisdiction profile surfaces, in route order. */\nexport const JURISDICTION_TABS: readonly FilterOption<string>[] = [\n { value: PROFILE_TAB, label: 'Profile' },\n { value: 'governance', label: 'Governance' },\n { value: 'budget', label: 'Budget' },\n { value: 'projects', label: 'Projects' },\n { value: 'indicators', label: 'Indicators' },\n { value: 'benchmark', label: 'Benchmark' },\n { value: 'services', label: 'Services' },\n { value: 'assets', label: 'Public assets' },\n { value: 'elections', label: 'Elections' },\n { value: 'consultations', label: 'Consultations' },\n { value: 'open-data', label: 'Open data' },\n { value: 'timeline', label: 'Timeline' },\n { value: 'corrections', label: 'Corrections' },\n];\n\nconst TAB_SEGMENTS = new Set(JURISDICTION_TABS.map((tab) => tab.value));\n\nconst verificationTone: Record<GovVerificationStatus, string> = {\n UNVERIFIED: 'bg-bg-sunken text-text-secondary',\n OFFICIAL: 'bg-status-success-bg-subtle text-status-success-text',\n COMMUNITY_VERIFIED: 'bg-[var(--color-accent-soft)] text-action-primary-text',\n DISPUTED: 'bg-status-error-bg-subtle text-status-error-text',\n};\n\n/** Provenance grade chip — shared by every Community Intelligence surface. */\nexport const VerificationChip: FC<{ status: GovVerificationStatus; className?: string }> = ({\n status,\n className,\n}) => (\n <span\n className={cn(\n 'inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium',\n verificationTone[status],\n className\n )}\n >\n {GOV_VERIFICATION_LABELS[status]}\n </span>\n);\n\nexport interface JurisdictionLayoutProps {\n children: ReactNode;\n /** Page-specific header actions, rendered before the Follow control. */\n actions?: ReactNode;\n /** Caption under the region name. Defaults to the admin level + official code. */\n description?: string;\n}\n\nexport const JurisdictionLayout: FC<JurisdictionLayoutProps> = ({\n children,\n actions,\n description,\n}) => {\n const { jurisdictionId } = useParams<{ jurisdictionId: string }>();\n const { pathname } = useLocation();\n const { navigateTo } = useGovCitizenHub();\n\n const {\n data: overview,\n isLoading,\n isError,\n refetch,\n } = useGovJurisdictionOverview(jurisdictionId);\n const followJurisdiction = useGovFollowJurisdiction();\n const unfollowJurisdiction = useGovUnfollowJurisdiction();\n\n const lastSegment = pathname.split('/').filter(Boolean).pop() ?? '';\n const activeTab = TAB_SEGMENTS.has(lastSegment) ? lastSegment : PROFILE_TAB;\n\n const goToTab = (tab: string) => {\n if (!jurisdictionId) return;\n navigateTo(\n tab === PROFILE_TAB\n ? `intelligence/${jurisdictionId}`\n : `intelligence/${jurisdictionId}/${tab}`\n );\n };\n\n if (isLoading) {\n return (\n <PageLayout\n title=\"Jurisdiction\"\n back={{ label: 'Community Intelligence', onClick: () => navigateTo('intelligence') }}\n >\n <LoadingView label=\"Loading jurisdiction…\" />\n </PageLayout>\n );\n }\n\n if (isError || !overview) {\n return (\n <PageLayout\n title=\"Jurisdiction\"\n back={{ label: 'Community Intelligence', onClick: () => navigateTo('intelligence') }}\n >\n <ErrorView\n message=\"We couldn't load this jurisdiction profile.\"\n onRetry={() => {\n void refetch();\n }}\n />\n </PageLayout>\n );\n }\n\n const { jurisdiction, adminLevel, parent } = overview;\n const following = overview.isFollowedByMe;\n const followBusy = followJurisdiction.isPending || unfollowJurisdiction.isPending;\n\n const toggleFollow = async () => {\n if (!jurisdictionId) return;\n try {\n if (following) {\n await unfollowJurisdiction.mutateAsync(jurisdictionId);\n notify.success('Unfollowed', `You will no longer get updates for ${jurisdiction.name}.`);\n } else {\n await followJurisdiction.mutateAsync({ jurisdictionId });\n notify.success('Following', `You will get updates for ${jurisdiction.name}.`);\n }\n } catch (err) {\n notify.error('Could not update your follow preference', describeError(err));\n }\n };\n\n const breadcrumbs: Breadcrumb[] = [\n { label: 'Community Intelligence', onClick: () => navigateTo('intelligence') },\n ...(parent\n ? [{ label: parent.name, onClick: () => navigateTo(`intelligence/${parent.id}`) }]\n : []),\n { label: jurisdiction.name },\n ];\n\n const caption =\n description ??\n [adminLevel?.name, jurisdiction.officialCode ? `Code ${jurisdiction.officialCode}` : null]\n .filter(Boolean)\n .join(' · ');\n\n return (\n <PageLayout\n breadcrumbs={breadcrumbs}\n title={\n <span className=\"flex flex-wrap items-center gap-x-3 gap-y-2\">\n <span className=\"text-text-primary\">{jurisdiction.name}</span>\n {jurisdiction.localName && (\n <span className=\"text-lg font-normal text-text-secondary\">\n {jurisdiction.localName}\n </span>\n )}\n {adminLevel && (\n <span className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {adminLevel.name}\n </span>\n )}\n <VerificationChip status={jurisdiction.verification} />\n </span>\n }\n description={caption || undefined}\n actions={\n <div className=\"flex flex-wrap items-center gap-2\">\n {actions}\n <span className=\"inline-flex items-center gap-1.5 text-sm text-text-muted tabular-nums\">\n <Users className=\"size-4\" aria-hidden=\"true\" />\n {formatNumber(overview.followerCount)}\n </span>\n <Button\n variant={following ? 'outline' : 'default'}\n onClick={() => {\n void toggleFollow();\n }}\n disabled={followBusy}\n >\n {following ? (\n <>\n <BellOff className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" /> Unfollow\n </>\n ) : (\n <>\n <BellRing className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" /> Follow\n </>\n )}\n </Button>\n </div>\n }\n >\n <div className=\"mb-6\">\n <FilterTabs\n variant=\"underline\"\n options={[...JURISDICTION_TABS]}\n value={activeTab}\n onChange={goToTab}\n className=\"w-full\"\n />\n </div>\n {children}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAsCA,IAAM,IAAc,WAGP,IAAqD;CAChE;EAAE,OAAO;EAAa,OAAO;CAAU;CACvC;EAAE,OAAO;EAAc,OAAO;CAAa;CAC3C;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAY,OAAO;CAAW;CACvC;EAAE,OAAO;EAAc,OAAO;CAAa;CAC3C;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAY,OAAO;CAAW;CACvC;EAAE,OAAO;EAAU,OAAO;CAAgB;CAC1C;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAiB,OAAO;CAAgB;CACjD;EAAE,OAAO;EAAa,OAAO;CAAY;CACzC;EAAE,OAAO;EAAY,OAAO;CAAW;CACvC;EAAE,OAAO;EAAe,OAAO;CAAc;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CACE,kBAAC,GAAD;MAAU,WAAU;MAAiB,eAAY;KAAQ,CAAA,GAAC,SAC1D,EAAA,CAAA;IAEE,CAAA;GACL;;YA3CT,CA8CE,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD;IACE,SAAQ;IACR,SAAS,CAAC,GAAG,CAAiB;IAC9B,OAAO;IACP,UAAU;IACV,WAAU;GACX,CAAA;EACE,CAAA,GACJ,CACS;;AAEhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JurisdictionProfilePage.d.ts","sourceRoot":"","sources":["../../../../src/govcitizenhub/pages/intelligence/JurisdictionProfilePage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,KAAK,EAAE,EAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"JurisdictionProfilePage.d.ts","sourceRoot":"","sources":["../../../../src/govcitizenhub/pages/intelligence/JurisdictionProfilePage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,KAAK,EAAE,EAAwB,MAAM,OAAO,CAAC;AAysBtD,eAAO,MAAM,uBAAuB,EAAE,EAqCrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JurisdictionProfilePage.js","names":[],"sources":["../../../../src/govcitizenhub/pages/intelligence/JurisdictionProfilePage.tsx"],"sourcesContent":["/**\n * JurisdictionProfilePage — the permanent public record of one region.\n * @module govcitizenhub/pages/intelligence\n *\n * Route: `/govcitizenhub/intelligence/:jurisdictionId`\n *\n * Renders inside {@link JurisdictionLayout}, which owns the shared hero\n * (ancestor breadcrumb, region name + local name, administrative-tier chip,\n * verification grade, publication status and the Follow control). This page\n * fills the body from the SAME single round trip — `govJurisdictionOverview` —\n * so the profile costs one request no matter how much of it is populated:\n *\n * - a summary strip of the published headline facts,\n * - the profile facts the region has actually recorded,\n * - a contact panel including the public emergency numbers,\n * - the composite scorecard with a per-domain breakdown,\n * - the deterministic, evidence-carrying insights grouped by severity, and\n * - quick links whose counts are the real counts, each opening its own tab.\n *\n * NO FABRICATED DATA. A fact that has not been published is left out entirely; a\n * domain with no measured core indicator says \"Not enough data\"; and when the\n * composite score is withheld for low coverage the page explains exactly how\n * much coverage there is instead of showing a number. GovCitizenHub is a\n * transparency product — an invented figure here would be a lie.\n */\n\nimport { type FC, useCallback, useMemo } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n AlertCircle,\n AlertTriangle,\n Building2,\n CalendarDays,\n Database,\n Gauge,\n Globe,\n Home,\n Info,\n Landmark,\n Lightbulb,\n Mail,\n MessageSquare,\n Minus,\n Network,\n Phone,\n Ruler,\n ScrollText,\n Siren,\n TrendingDown,\n TrendingUp,\n Users,\n Wallet,\n Wrench,\n} from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\n\nimport { SectionCard } from '../../components/SectionCard';\nimport { SummaryStrip, type SummaryStat } from '../../components/SummaryStrip';\nimport { KeyValueList, type KeyValueItem } from '../../components/KeyValueList';\nimport { MetricsCard } from '../../components/MetricsCard';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { JurisdictionLayout } from './JurisdictionLayout';\nimport { useGovJurisdictionOverview } from '../../hooks';\nimport { useGovCitizenHub } from '../../context';\nimport { cn } from '../../utils/cn';\nimport {\n formatCurrency,\n formatDate,\n formatEnumLabel,\n formatNumber,\n formatRelativeTime,\n} from '../../utils/formatters';\nimport {\n GOV_INDICATOR_DOMAIN_LABELS,\n type GovDomainScore,\n type GovInsightSeverity,\n type GovJson,\n type GovJurisdictionInsight,\n type GovJurisdictionOverview,\n type GovJurisdictionScorecard,\n type GovTrendDirection,\n} from '../../types';\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/** Keep a 0-100 score inside the bar even if a future rule over/undershoots. */\nconst clampPercent = (value: number): number => Math.max(0, Math.min(100, value));\n\n/** A public emergency contact as published on the jurisdiction profile. */\ninterface EmergencyNumber {\n label: string;\n number: string;\n}\n\n/**\n * `emergencyNumbers` is an opaque JSON column documented as `[{ label, number }]`.\n * Anything that does not match that shape is dropped rather than guessed at, so\n * a malformed row can never render a misleading emergency number.\n */\nfunction parseEmergencyNumbers(raw: GovJson | undefined): EmergencyNumber[] {\n if (!Array.isArray(raw)) return [];\n const parsed: EmergencyNumber[] = [];\n for (const entry of raw) {\n if (entry === null || typeof entry !== 'object' || Array.isArray(entry)) continue;\n // Narrowed to a non-null, non-array object above; TS cannot index `object`,\n // so this cast only re-states what the guard already proved.\n const record = entry as Record<string, unknown>;\n const label = typeof record.label === 'string' ? record.label.trim() : '';\n const number =\n typeof record.number === 'string'\n ? record.number.trim()\n : typeof record.number === 'number'\n ? String(record.number)\n : '';\n if (!label || !number) continue;\n parsed.push({ label, number });\n }\n return parsed;\n}\n\nconst TREND_META: Record<\n GovTrendDirection,\n { icon: typeof TrendingUp; tone: string; label: string }\n> = {\n UP: { icon: TrendingUp, tone: 'text-status-success-text', label: 'Improving' },\n DOWN: { icon: TrendingDown, tone: 'text-status-error-text', label: 'Declining' },\n FLAT: { icon: Minus, tone: 'text-text-muted', label: 'Flat' },\n};\n\nconst SEVERITY_ORDER: readonly GovInsightSeverity[] = ['HIGH', 'MEDIUM', 'LOW', 'INFO'];\n\nconst SEVERITY_META: Record<\n GovInsightSeverity,\n { label: string; tone: string; icon: typeof AlertTriangle }\n> = {\n HIGH: {\n label: 'High',\n tone: 'bg-status-error-bg-subtle text-status-error-text',\n icon: AlertTriangle,\n },\n MEDIUM: {\n label: 'Medium',\n tone: 'bg-status-warning-bg-subtle text-status-warning-text',\n icon: AlertCircle,\n },\n LOW: {\n label: 'Low',\n tone: 'bg-[var(--color-accent-soft)] text-action-primary-text',\n icon: Info,\n },\n INFO: { label: 'Info', tone: 'bg-bg-sunken text-text-secondary', icon: Info },\n};\n\n// ============================================================================\n// Scorecard\n// ============================================================================\n\nconst DomainScoreRow: FC<{ domain: GovDomainScore }> = ({ domain }) => {\n const trend = TREND_META[domain.trend];\n const TrendIcon = trend.icon;\n const measured = domain.score != null;\n\n return (\n <li>\n <div className=\"flex items-baseline justify-between gap-3\">\n <span className=\"truncate text-sm font-medium text-text-primary\">\n {GOV_INDICATOR_DOMAIN_LABELS[domain.domain]}\n </span>\n <span className=\"shrink-0 text-sm\">\n {measured ? (\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {formatNumber(domain.score, { maximumFractionDigits: 1 })}\n </span>\n ) : (\n <span className=\"text-text-muted\">Not enough data</span>\n )}\n </span>\n </div>\n <div className=\"mt-1.5 flex items-center gap-3\">\n <span\n className=\"h-2 flex-1 overflow-hidden rounded-full bg-bg-sunken\"\n role=\"img\"\n aria-label={\n measured\n ? `${GOV_INDICATOR_DOMAIN_LABELS[domain.domain]} scores ${formatNumber(domain.score, { maximumFractionDigits: 1 })} out of 100`\n : `${GOV_INDICATOR_DOMAIN_LABELS[domain.domain]} has no measured core indicator`\n }\n >\n {measured && domain.score != null && (\n <span\n className=\"block h-full rounded-full bg-[var(--color-action-primary-bg)]\"\n style={{ width: `${clampPercent(domain.score)}%` }}\n />\n )}\n </span>\n <span className=\"w-32 shrink-0 text-right text-xs text-text-muted tabular-nums\">\n {formatNumber(domain.measuredCount)}/{formatNumber(domain.indicatorCount)} measured\n </span>\n </div>\n {domain.changePercent != null && (\n <p className={cn('mt-1 flex items-center gap-1 text-xs font-medium', trend.tone)}>\n <TrendIcon className=\"size-3.5\" aria-hidden=\"true\" />\n {formatNumber(domain.changePercent, { maximumFractionDigits: 1 })}%\n <span className=\"font-normal text-text-muted\">since the previous period</span>\n </p>\n )}\n </li>\n );\n};\n\nconst ScorecardPanel: FC<{ scorecard: GovJurisdictionScorecard }> = ({ scorecard }) => {\n const published = scorecard.overallScore != null;\n\n return (\n <div className=\"space-y-5\">\n <div className=\"flex flex-wrap items-end gap-x-8 gap-y-4\">\n <div>\n <p className=\"flex items-baseline gap-1.5\">\n <span className=\"text-5xl font-bold tabular-nums text-text-primary\">\n {published\n ? formatNumber(scorecard.overallScore, { maximumFractionDigits: 1 })\n : '—'}\n </span>\n <span className=\"text-lg font-medium text-text-muted\">/ 100</span>\n </p>\n <p className=\"mt-1 text-sm text-text-muted\">\n Composite score\n {scorecard.periodLabel ? ` · ${scorecard.periodLabel}` : ''}\n </p>\n </div>\n\n <div className=\"min-w-[14rem] flex-1\">\n <div className=\"flex items-baseline justify-between gap-3\">\n <span className=\"text-sm text-text-muted\">Indicator coverage</span>\n <span className=\"text-sm font-semibold tabular-nums text-text-primary\">\n {formatNumber(scorecard.coveragePercent, { maximumFractionDigits: 1 })}%\n </span>\n </div>\n <span className=\"mt-1.5 block h-2 overflow-hidden rounded-full bg-bg-sunken\">\n <span\n className=\"block h-full rounded-full bg-[var(--color-action-primary-bg)]\"\n style={{ width: `${clampPercent(scorecard.coveragePercent)}%` }}\n />\n </span>\n <p className=\"mt-1.5 text-xs text-text-muted tabular-nums\">\n {formatNumber(scorecard.measuredCount)} of {formatNumber(scorecard.indicatorCount)} core\n indicators measured\n </p>\n </div>\n </div>\n\n {!published && (\n <p className=\"rounded-card border border-border-seam bg-bg-sunken px-4 py-3 text-sm text-text-secondary\">\n A composite score is only published once enough core indicators carry a value — below that\n threshold a single number would be more misleading than no number. Coverage here is{' '}\n <span className=\"font-medium text-text-primary tabular-nums\">\n {formatNumber(scorecard.coveragePercent, { maximumFractionDigits: 1 })}%\n </span>\n , so the domain breakdown below is published on its own.\n </p>\n )}\n\n {scorecard.domains.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">\n No core indicators are defined for this workspace yet, so there is nothing to score.\n </p>\n ) : (\n <ul className=\"space-y-4\">\n {scorecard.domains.map((domain) => (\n <DomainScoreRow key={domain.domain} domain={domain} />\n ))}\n </ul>\n )}\n\n <p className=\"text-xs text-text-muted\">\n Generated {formatRelativeTime(scorecard.generatedAt)} from published indicator values.\n </p>\n </div>\n );\n};\n\n// ============================================================================\n// Insights\n// ============================================================================\n\nconst InsightCard: FC<{ insight: GovJurisdictionInsight }> = ({ insight }) => {\n const meta = SEVERITY_META[insight.severity];\n const Icon = meta.icon;\n\n return (\n <article className=\"rounded-card border border-border-seam bg-bg-surface p-4\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n meta.tone\n )}\n >\n <Icon className=\"size-3\" aria-hidden=\"true\" /> {meta.label}\n </span>\n <span className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {formatEnumLabel(insight.kind)}\n </span>\n {insight.domain && (\n <span className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {GOV_INDICATOR_DOMAIN_LABELS[insight.domain]}\n </span>\n )}\n {insight.indicatorCode && (\n <span className=\"font-mono text-xs text-text-muted\">{insight.indicatorCode}</span>\n )}\n </div>\n\n <h3 className=\"mt-2.5 text-sm font-semibold text-text-primary\">{insight.title}</h3>\n <p className=\"mt-1 text-sm text-text-secondary\">{insight.detail}</p>\n\n {insight.evidence.length > 0 && (\n <div className=\"mt-3 border-t border-border-seam pt-3\">\n <p className=\"text-xs font-medium uppercase tracking-wide text-text-muted\">Evidence</p>\n <ul className=\"mt-1.5 space-y-1\">\n {insight.evidence.map((line, index) => (\n <li key={index} className=\"flex gap-2 text-xs text-text-secondary\">\n <span aria-hidden=\"true\" className=\"text-text-muted\">\n ·\n </span>\n <span className=\"min-w-0\">{line}</span>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n <p className=\"mt-3 text-xs text-text-muted\">\n Derived {formatRelativeTime(insight.generatedAt)}\n </p>\n </article>\n );\n};\n\nconst InsightsPanel: FC<{ insights: readonly GovJurisdictionInsight[] }> = ({ insights }) => {\n const grouped = useMemo(\n () =>\n SEVERITY_ORDER.map((severity) => ({\n severity,\n items: insights.filter((insight) => insight.severity === severity),\n })).filter((group) => group.items.length > 0),\n [insights]\n );\n\n if (grouped.length === 0) {\n return (\n <p className=\"text-sm text-text-secondary\">\n No insights yet. They are derived automatically — from trends, targets, budget variance,\n project delays and indicator coverage — as soon as this region has published data to\n compare.\n </p>\n );\n }\n\n return (\n <div className=\"space-y-5\">\n {grouped.map((group) => (\n <section key={group.severity}>\n <h3 className=\"mb-2 text-xs font-semibold uppercase tracking-wide text-text-muted\">\n {SEVERITY_META[group.severity].label} · {formatNumber(group.items.length)}\n </h3>\n <div className=\"space-y-3\">\n {group.items.map((insight, index) => (\n <InsightCard key={`${insight.kind}-${insight.indicatorCode ?? index}`} insight={insight} />\n ))}\n </div>\n </section>\n ))}\n </div>\n );\n};\n\n// ============================================================================\n// Body\n// ============================================================================\n\ninterface ProfileBodyProps {\n overview: GovJurisdictionOverview;\n onNavigate: (relativePath: string) => void;\n}\n\nconst ProfileBody: FC<ProfileBodyProps> = ({ overview, onNavigate }) => {\n const { jurisdiction, currentBudget } = overview;\n const id = jurisdiction.id;\n\n /** Headline numeric facts — only those the region has actually published. */\n const headlineStats = useMemo<SummaryStat[]>(() => {\n const stats: SummaryStat[] = [];\n if (jurisdiction.population != null) {\n stats.push({\n label:\n jurisdiction.populationYear != null\n ? `Population (${jurisdiction.populationYear})`\n : 'Population',\n value: formatNumber(jurisdiction.population),\n icon: <Users />,\n });\n }\n if (jurisdiction.areaSqKm != null) {\n stats.push({\n label: 'Area',\n value: formatNumber(jurisdiction.areaSqKm, { maximumFractionDigits: 1 }),\n hint: 'km²',\n icon: <Ruler />,\n });\n }\n if (jurisdiction.populationDensity != null) {\n stats.push({\n label: 'Population density',\n value: formatNumber(jurisdiction.populationDensity, { maximumFractionDigits: 1 }),\n hint: '/ km²',\n icon: <Gauge />,\n });\n }\n if (jurisdiction.households != null) {\n stats.push({\n label: 'Households',\n value: formatNumber(jurisdiction.households),\n icon: <Home />,\n });\n }\n return stats;\n }, [jurisdiction]);\n\n /** The remaining profile facts, rendered only where a value exists. */\n const profileFacts = useMemo<KeyValueItem[]>(() => {\n const facts: KeyValueItem[] = [];\n if (jurisdiction.establishedOn) {\n facts.push({ label: 'Established', value: formatDate(jurisdiction.establishedOn) });\n }\n if (jurisdiction.headquarters) {\n facts.push({ label: 'Headquarters', value: jurisdiction.headquarters });\n }\n if (jurisdiction.timezone) {\n facts.push({ label: 'Timezone', value: jurisdiction.timezone });\n }\n if (jurisdiction.languages.length > 0) {\n facts.push({ label: 'Languages', value: jurisdiction.languages.join(', ') });\n }\n if (jurisdiction.currencyCode) {\n facts.push({ label: 'Currency', value: jurisdiction.currencyCode });\n }\n if (jurisdiction.officialCode) {\n facts.push({\n label: 'Official code',\n value: <span className=\"font-mono\">{jurisdiction.officialCode}</span>,\n });\n }\n facts.push({ label: 'Country', value: jurisdiction.countryCode });\n if (jurisdiction.publishedAt) {\n facts.push({ label: 'Published', value: formatDate(jurisdiction.publishedAt) });\n }\n if (jurisdiction.sourceName) {\n facts.push({\n label: 'Source',\n value: jurisdiction.sourceUrl ? (\n <a\n href={jurisdiction.sourceUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className=\"text-action-primary-text underline-offset-2 hover:underline\"\n >\n {jurisdiction.sourceName}\n </a>\n ) : (\n jurisdiction.sourceName\n ),\n });\n }\n return facts;\n }, [jurisdiction]);\n\n const emergencyNumbers = useMemo(\n () => parseEmergencyNumbers(jurisdiction.emergencyNumbers),\n [jurisdiction.emergencyNumbers]\n );\n\n const hasContact = Boolean(\n jurisdiction.officialWebsite || jurisdiction.contactEmail || jurisdiction.contactPhone\n );\n\n const quickLinks = useMemo(\n () => [\n {\n key: 'children',\n label: 'Sub-regions',\n count: overview.childCount,\n icon: <Network />,\n to: `intelligence?parentId=${encodeURIComponent(id)}`,\n },\n {\n key: 'officials',\n label: 'Office holders',\n count: overview.officialCount,\n icon: <Users />,\n to: `intelligence/${id}/governance`,\n },\n {\n key: 'projects',\n label: 'Active projects',\n count: overview.activeProjectCount,\n icon: <Wrench />,\n to: `intelligence/${id}/projects`,\n },\n {\n key: 'assets',\n label: 'Public assets',\n count: overview.publicAssetCount,\n icon: <Landmark />,\n to: `intelligence/${id}/assets`,\n },\n {\n key: 'datasets',\n label: 'Published datasets',\n count: overview.publishedDatasetCount,\n icon: <Database />,\n to: `intelligence/${id}/open-data`,\n },\n {\n key: 'consultations',\n label: 'Open consultations',\n count: overview.openConsultationCount,\n icon: <MessageSquare />,\n to: `intelligence/${id}/consultations`,\n },\n ],\n [overview, id]\n );\n\n return (\n <div className=\"space-y-4\">\n {headlineStats.length > 0 && <SummaryStrip stats={headlineStats} />}\n\n {/* Quick links — real counts, each opening the tab that owns them. */}\n <div className=\"grid gap-4 sm:grid-cols-2 xl:grid-cols-3\">\n {quickLinks.map((link) => (\n <MetricsCard\n key={link.key}\n icon={link.icon}\n value={formatNumber(link.count)}\n label={link.label}\n onClick={() => onNavigate(link.to)}\n />\n ))}\n </div>\n\n <p className=\"text-sm text-text-muted\">\n <Users className=\"mr-1.5 inline size-4 align-text-bottom\" aria-hidden=\"true\" />\n <span className=\"font-medium tabular-nums text-text-secondary\">\n {formatNumber(overview.followerCount)}\n </span>{' '}\n {overview.followerCount === 1 ? 'person follows' : 'people follow'} this region.\n </p>\n\n <div className=\"grid gap-4 lg:grid-cols-3\">\n <div className=\"space-y-4 lg:col-span-2\">\n {(jurisdiction.summary || jurisdiction.climateSummary) && (\n <SectionCard title=\"About\" icon={<ScrollText />} className=\"border-border-seam\">\n {jurisdiction.summary && (\n <p className=\"whitespace-pre-wrap text-sm text-text-secondary\">\n {jurisdiction.summary}\n </p>\n )}\n {jurisdiction.climateSummary && (\n <p className=\"mt-3 whitespace-pre-wrap border-t border-border-seam pt-3 text-sm text-text-secondary\">\n <span className=\"font-medium text-text-primary\">Climate: </span>\n {jurisdiction.climateSummary}\n </p>\n )}\n </SectionCard>\n )}\n\n <SectionCard title=\"Performance scorecard\" icon={<Gauge />} className=\"border-border-seam\">\n {overview.scorecard ? (\n <ScorecardPanel scorecard={overview.scorecard} />\n ) : (\n <p className=\"text-sm text-text-secondary\">\n No scorecard yet. One is computed automatically once core indicators are defined and\n this region has published values against them.\n </p>\n )}\n </SectionCard>\n\n <SectionCard title=\"Insights\" icon={<Lightbulb />} className=\"border-border-seam\">\n <InsightsPanel insights={overview.insights} />\n </SectionCard>\n </div>\n\n <div className=\"space-y-4\">\n <SectionCard title=\"Key facts\" icon={<Building2 />} className=\"border-border-seam\">\n {profileFacts.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">No profile details published yet.</p>\n ) : (\n <KeyValueList items={profileFacts} />\n )}\n </SectionCard>\n\n <SectionCard title=\"Contact\" icon={<Phone />} className=\"border-border-seam\">\n {!hasContact && emergencyNumbers.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">\n No contact details have been published for this region yet.\n </p>\n ) : (\n <div className=\"space-y-3\">\n {jurisdiction.officialWebsite && (\n <a\n href={jurisdiction.officialWebsite}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className=\"flex items-center gap-2.5 text-sm text-action-primary-text underline-offset-2 hover:underline\"\n >\n <Globe className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span className=\"min-w-0 truncate\">{jurisdiction.officialWebsite}</span>\n </a>\n )}\n {jurisdiction.contactEmail && (\n <a\n href={`mailto:${jurisdiction.contactEmail}`}\n className=\"flex items-center gap-2.5 text-sm text-action-primary-text underline-offset-2 hover:underline\"\n >\n <Mail className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span className=\"min-w-0 truncate\">{jurisdiction.contactEmail}</span>\n </a>\n )}\n {jurisdiction.contactPhone && (\n <a\n href={`tel:${jurisdiction.contactPhone}`}\n className=\"flex items-center gap-2.5 text-sm text-action-primary-text underline-offset-2 hover:underline\"\n >\n <Phone className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span className=\"min-w-0 truncate\">{jurisdiction.contactPhone}</span>\n </a>\n )}\n\n {emergencyNumbers.length > 0 && (\n <div className=\"border-t border-border-seam pt-3\">\n <p className=\"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wide text-text-muted\">\n <Siren className=\"size-3.5\" aria-hidden=\"true\" /> Emergency numbers\n </p>\n <ul className=\"mt-2 space-y-1.5\">\n {emergencyNumbers.map((entry) => (\n <li\n key={`${entry.label}-${entry.number}`}\n className=\"flex items-baseline justify-between gap-4\"\n >\n <span className=\"min-w-0 truncate text-sm text-text-secondary\">\n {entry.label}\n </span>\n <a\n href={`tel:${entry.number}`}\n className=\"shrink-0 text-sm font-semibold tabular-nums text-text-primary underline-offset-2 hover:underline\"\n >\n {entry.number}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n )}\n </SectionCard>\n\n {currentBudget && (\n <SectionCard\n title=\"Current budget\"\n icon={<Wallet />}\n className=\"border-border-seam\"\n actions={\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => onNavigate(`intelligence/${id}/budget`)}\n >\n Open\n </Button>\n }\n >\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-sm font-semibold text-text-primary\">\n {currentBudget.fiscalYear}\n </span>\n <StatusBadge status={currentBudget.status} />\n </div>\n <KeyValueList\n className=\"mt-3\"\n items={[\n {\n label: 'Planned revenue',\n value: formatCurrency(\n currentBudget.totalRevenuePlanned,\n currentBudget.currencyCode\n ),\n },\n {\n label: 'Planned expenditure',\n value: formatCurrency(\n currentBudget.totalExpensePlanned,\n currentBudget.currencyCode\n ),\n },\n {\n label: 'Period',\n value: (\n <span className=\"inline-flex items-center gap-1.5\">\n <CalendarDays className=\"size-3.5 text-text-muted\" aria-hidden=\"true\" />\n {formatDate(currentBudget.periodStart)} –{' '}\n {formatDate(currentBudget.periodEnd)}\n </span>\n ),\n },\n ]}\n />\n </SectionCard>\n )}\n </div>\n </div>\n </div>\n );\n};\n\n// ============================================================================\n// Page\n// ============================================================================\n\nexport const JurisdictionProfilePage: FC = () => {\n const { jurisdictionId } = useParams<{ jurisdictionId: string }>();\n const { navigateTo } = useGovCitizenHub();\n\n // Same query key as the layout's read, so this resolves from cache — the\n // profile costs exactly one round trip for the whole screen.\n const { data: overview, isLoading, isError, refetch } = useGovJurisdictionOverview(jurisdictionId);\n\n const handleRetry = useCallback(() => {\n void refetch();\n }, [refetch]);\n\n const goToDirectory = useCallback(() => navigateTo('intelligence'), [navigateTo]);\n\n return (\n <JurisdictionLayout>\n {isLoading ? (\n <LoadingView label=\"Loading jurisdiction profile…\" />\n ) : isError ? (\n <ErrorView message=\"We couldn't load this jurisdiction profile.\" onRetry={handleRetry} />\n ) : !overview ? (\n <EmptyState\n illustration=\"empty-search\"\n title=\"Jurisdiction not found\"\n description=\"This region has been removed, or it is not published in this workspace.\"\n action={<Button onClick={goToDirectory}>Browse jurisdictions</Button>}\n />\n ) : (\n <ProfileBody overview={overview} onNavigate={navigateTo} />\n )}\n </JurisdictionLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0FA,IAAM,KAAgB,MAA0B,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,CAAK,CAAC;AAahF,SAAS,EAAsB,GAA6C;CAC1E,IAAI,CAAC,MAAM,QAAQ,CAAG,GAAG,OAAO,CAAC;CACjC,IAAM,IAA4B,CAAC;CACnC,KAAK,IAAM,KAAS,GAAK;EACvB,IAAsB,OAAO,KAAU,aAAnC,KAA+C,MAAM,QAAQ,CAAK,GAAG;EAGzE,IAAM,IAAS,GACT,IAAQ,OAAO,EAAO,SAAU,WAAW,EAAO,MAAM,KAAK,IAAI,IACjE,IACJ,OAAO,EAAO,UAAW,WACrB,EAAO,OAAO,KAAK,IACnB,OAAO,EAAO,UAAW,WACvB,OAAO,EAAO,MAAM,IACpB;EACJ,CAAC,KAAS,CAAC,KACf,EAAO,KAAK;GAAE;GAAO;EAAO,CAAC;CAC/B;CACA,OAAO;AACT;AAEA,IAAM,IAGF;CACF,IAAI;EAAE,MAAM;EAAY,MAAM;EAA4B,OAAO;CAAY;CAC7E,MAAM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f,GAAG,CAAC,CAAO,CAAC,GAEN,IAAgB,QAAkB,EAAW,cAAc,GAAG,CAAC,CAAU,CAAC;CAEhF,OACE,kBAAC,GAAD,EAAA,UACG,IACC,kBAAC,GAAD,EAAa,OAAM,gCAAiC,CAAA,IAClD,IACF,kBAAC,GAAD;EAAW,SAAQ;EAA8C,SAAS;CAAc,CAAA,IACrF,IAQH,kBAAC,IAAD;EAAuB;EAAU,YAAY;CAAa,CAAA,IAP1D,kBAAC,GAAD;EACE,cAAa;EACb,OAAM;EACN,aAAY;EACZ,QAAQ,kBAAC,GAAD;GAAQ,SAAS;aAAe;EAA4B,CAAA;CACrE,CAAA,EAIe,CAAA;AAExB"}
|
|
1
|
+
{"version":3,"file":"JurisdictionProfilePage.js","names":[],"sources":["../../../../src/govcitizenhub/pages/intelligence/JurisdictionProfilePage.tsx"],"sourcesContent":["/**\n * JurisdictionProfilePage — the permanent public record of one region.\n * @module govcitizenhub/pages/intelligence\n *\n * Route: `/govcitizenhub/intelligence/:jurisdictionId`\n *\n * Renders inside {@link JurisdictionLayout}, which owns the shared hero\n * (ancestor breadcrumb, region name + local name, administrative-tier chip,\n * verification grade, publication status and the Follow control). This page\n * fills the body from the SAME single round trip — `govJurisdictionOverview` —\n * so the profile costs one request no matter how much of it is populated:\n *\n * - a summary strip of the published headline facts,\n * - the profile facts the region has actually recorded,\n * - a contact panel including the public emergency numbers,\n * - the composite scorecard with a per-domain breakdown,\n * - the deterministic, evidence-carrying insights grouped by severity, and\n * - quick links whose counts are the real counts, each opening its own tab.\n *\n * NO FABRICATED DATA. A fact that has not been published is left out entirely; a\n * domain with no measured core indicator says \"Not enough data\"; and when the\n * composite score is withheld for low coverage the page explains exactly how\n * much coverage there is instead of showing a number. GovCitizenHub is a\n * transparency product — an invented figure here would be a lie.\n */\n\nimport { type FC, useCallback, useMemo } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n AlertCircle,\n AlertTriangle,\n Building2,\n CalendarDays,\n Database,\n Gauge,\n Globe,\n Home,\n Info,\n Landmark,\n Lightbulb,\n Mail,\n MessageSquare,\n Minus,\n Network,\n Phone,\n Ruler,\n ScrollText,\n Siren,\n TrendingDown,\n TrendingUp,\n Users,\n Wallet,\n Wrench,\n} from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\n\nimport { SectionCard } from '../../components/SectionCard';\nimport { SummaryStrip, type SummaryStat } from '../../components/SummaryStrip';\nimport { KeyValueList, type KeyValueItem } from '../../components/KeyValueList';\nimport { MetricsCard } from '../../components/MetricsCard';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { JurisdictionLayout } from './JurisdictionLayout';\nimport { useGovJurisdictionOverview } from '../../hooks';\nimport { useGovCitizenHub } from '../../context';\nimport { cn } from '../../utils/cn';\nimport {\n formatCurrency,\n formatDate,\n formatEnumLabel,\n formatNumber,\n formatRelativeTime,\n} from '../../utils/formatters';\nimport {\n GOV_INDICATOR_DOMAIN_LABELS,\n type GovDomainScore,\n type GovInsightSeverity,\n type GovJson,\n type GovJurisdictionInsight,\n type GovJurisdictionOverview,\n type GovJurisdictionScorecard,\n type GovTrendDirection,\n} from '../../types';\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/** Keep a 0-100 score inside the bar even if a future rule over/undershoots. */\nconst clampPercent = (value: number): number => Math.max(0, Math.min(100, value));\n\n/** A public emergency contact as published on the jurisdiction profile. */\ninterface EmergencyNumber {\n label: string;\n number: string;\n}\n\n/**\n * `emergencyNumbers` is an opaque JSON column documented as `[{ label, number }]`.\n * Anything that does not match that shape is dropped rather than guessed at, so\n * a malformed row can never render a misleading emergency number.\n */\nfunction parseEmergencyNumbers(raw: GovJson | undefined): EmergencyNumber[] {\n if (!Array.isArray(raw)) return [];\n const parsed: EmergencyNumber[] = [];\n for (const entry of raw) {\n if (entry === null || typeof entry !== 'object' || Array.isArray(entry)) continue;\n // Narrowed to a non-null, non-array object above; TS cannot index `object`,\n // so this cast only re-states what the guard already proved.\n const record = entry as Record<string, unknown>;\n const label = typeof record.label === 'string' ? record.label.trim() : '';\n const number =\n typeof record.number === 'string'\n ? record.number.trim()\n : typeof record.number === 'number'\n ? String(record.number)\n : '';\n if (!label || !number) continue;\n parsed.push({ label, number });\n }\n return parsed;\n}\n\nconst TREND_META: Record<\n GovTrendDirection,\n { icon: typeof TrendingUp; tone: string; label: string }\n> = {\n UP: { icon: TrendingUp, tone: 'text-status-success-text', label: 'Improving' },\n DOWN: { icon: TrendingDown, tone: 'text-status-error-text', label: 'Declining' },\n FLAT: { icon: Minus, tone: 'text-text-muted', label: 'Flat' },\n};\n\nconst SEVERITY_ORDER: readonly GovInsightSeverity[] = ['HIGH', 'MEDIUM', 'LOW', 'INFO'];\n\nconst SEVERITY_META: Record<\n GovInsightSeverity,\n { label: string; tone: string; icon: typeof AlertTriangle }\n> = {\n HIGH: {\n label: 'High',\n tone: 'bg-status-error-bg-subtle text-status-error-text',\n icon: AlertTriangle,\n },\n MEDIUM: {\n label: 'Medium',\n tone: 'bg-status-warning-bg-subtle text-status-warning-text',\n icon: AlertCircle,\n },\n LOW: {\n label: 'Low',\n tone: 'bg-[var(--color-accent-soft)] text-action-primary-text',\n icon: Info,\n },\n INFO: { label: 'Info', tone: 'bg-bg-sunken text-text-secondary', icon: Info },\n};\n\n// ============================================================================\n// Scorecard\n// ============================================================================\n\nconst DomainScoreRow: FC<{ domain: GovDomainScore }> = ({ domain }) => {\n const trend = TREND_META[domain.trend];\n const TrendIcon = trend.icon;\n const measured = domain.score != null;\n\n return (\n <li>\n <div className=\"flex items-baseline justify-between gap-3\">\n <span className=\"truncate text-sm font-medium text-text-primary\">\n {GOV_INDICATOR_DOMAIN_LABELS[domain.domain]}\n </span>\n <span className=\"shrink-0 text-sm\">\n {measured ? (\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {formatNumber(domain.score, { maximumFractionDigits: 1 })}\n </span>\n ) : (\n <span className=\"text-text-muted\">Not enough data</span>\n )}\n </span>\n </div>\n <div className=\"mt-1.5 flex items-center gap-3\">\n <span\n className=\"h-2 flex-1 overflow-hidden rounded-full bg-bg-sunken\"\n role=\"img\"\n aria-label={\n measured\n ? `${GOV_INDICATOR_DOMAIN_LABELS[domain.domain]} scores ${formatNumber(domain.score, { maximumFractionDigits: 1 })} out of 100`\n : `${GOV_INDICATOR_DOMAIN_LABELS[domain.domain]} has no measured core indicator`\n }\n >\n {measured && domain.score != null && (\n <span\n className=\"block h-full rounded-full bg-[var(--color-action-primary-bg)]\"\n style={{ width: `${clampPercent(domain.score)}%` }}\n />\n )}\n </span>\n <span className=\"w-32 shrink-0 text-right text-xs text-text-muted tabular-nums\">\n {formatNumber(domain.measuredCount)}/{formatNumber(domain.indicatorCount)} measured\n </span>\n </div>\n {domain.changePercent != null && (\n <p className={cn('mt-1 flex items-center gap-1 text-xs font-medium', trend.tone)}>\n <TrendIcon className=\"size-3.5\" aria-hidden=\"true\" />\n {formatNumber(domain.changePercent, { maximumFractionDigits: 1 })}%\n <span className=\"font-normal text-text-muted\">since the previous period</span>\n </p>\n )}\n </li>\n );\n};\n\nconst ScorecardPanel: FC<{ scorecard: GovJurisdictionScorecard }> = ({ scorecard }) => {\n const published = scorecard.overallScore != null;\n\n return (\n <div className=\"space-y-5\">\n <div className=\"flex flex-wrap items-end gap-x-8 gap-y-4\">\n <div>\n <p className=\"flex items-baseline gap-1.5\">\n <span className=\"text-5xl font-bold tabular-nums text-text-primary\">\n {published ? formatNumber(scorecard.overallScore, { maximumFractionDigits: 1 }) : '—'}\n </span>\n <span className=\"text-lg font-medium text-text-muted\">/ 100</span>\n </p>\n <p className=\"mt-1 text-sm text-text-muted\">\n Composite score\n {scorecard.periodLabel ? ` · ${scorecard.periodLabel}` : ''}\n </p>\n </div>\n\n <div className=\"min-w-[14rem] flex-1\">\n <div className=\"flex items-baseline justify-between gap-3\">\n <span className=\"text-sm text-text-muted\">Indicator coverage</span>\n <span className=\"text-sm font-semibold tabular-nums text-text-primary\">\n {formatNumber(scorecard.coveragePercent, { maximumFractionDigits: 1 })}%\n </span>\n </div>\n <span className=\"mt-1.5 block h-2 overflow-hidden rounded-full bg-bg-sunken\">\n <span\n className=\"block h-full rounded-full bg-[var(--color-action-primary-bg)]\"\n style={{ width: `${clampPercent(scorecard.coveragePercent)}%` }}\n />\n </span>\n <p className=\"mt-1.5 text-xs text-text-muted tabular-nums\">\n {formatNumber(scorecard.measuredCount)} of {formatNumber(scorecard.indicatorCount)} core\n indicators measured\n </p>\n </div>\n </div>\n\n {!published && (\n <p className=\"rounded-card border border-border-seam bg-bg-sunken px-4 py-3 text-sm text-text-secondary\">\n A composite score is only published once enough core indicators carry a value — below that\n threshold a single number would be more misleading than no number. Coverage here is{' '}\n <span className=\"font-medium text-text-primary tabular-nums\">\n {formatNumber(scorecard.coveragePercent, { maximumFractionDigits: 1 })}%\n </span>\n , so the domain breakdown below is published on its own.\n </p>\n )}\n\n {scorecard.domains.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">\n No core indicators are defined for this workspace yet, so there is nothing to score.\n </p>\n ) : (\n <ul className=\"space-y-4\">\n {scorecard.domains.map((domain) => (\n <DomainScoreRow key={domain.domain} domain={domain} />\n ))}\n </ul>\n )}\n\n <p className=\"text-xs text-text-muted\">\n Generated {formatRelativeTime(scorecard.generatedAt)} from published indicator values.\n </p>\n </div>\n );\n};\n\n// ============================================================================\n// Insights\n// ============================================================================\n\nconst InsightCard: FC<{ insight: GovJurisdictionInsight }> = ({ insight }) => {\n const meta = SEVERITY_META[insight.severity];\n const Icon = meta.icon;\n\n return (\n <article className=\"rounded-card border border-border-seam bg-bg-surface p-4\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n meta.tone\n )}\n >\n <Icon className=\"size-3\" aria-hidden=\"true\" /> {meta.label}\n </span>\n <span className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {formatEnumLabel(insight.kind)}\n </span>\n {insight.domain && (\n <span className=\"rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {GOV_INDICATOR_DOMAIN_LABELS[insight.domain]}\n </span>\n )}\n {insight.indicatorCode && (\n <span className=\"font-mono text-xs text-text-muted\">{insight.indicatorCode}</span>\n )}\n </div>\n\n <h3 className=\"mt-2.5 text-sm font-semibold text-text-primary\">{insight.title}</h3>\n <p className=\"mt-1 text-sm text-text-secondary\">{insight.detail}</p>\n\n {insight.evidence.length > 0 && (\n <div className=\"mt-3 border-t border-border-seam pt-3\">\n <p className=\"text-xs font-medium uppercase tracking-wide text-text-muted\">Evidence</p>\n <ul className=\"mt-1.5 space-y-1\">\n {insight.evidence.map((line, index) => (\n <li key={index} className=\"flex gap-2 text-xs text-text-secondary\">\n <span aria-hidden=\"true\" className=\"text-text-muted\">\n ·\n </span>\n <span className=\"min-w-0\">{line}</span>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n <p className=\"mt-3 text-xs text-text-muted\">\n Derived {formatRelativeTime(insight.generatedAt)}\n </p>\n </article>\n );\n};\n\nconst InsightsPanel: FC<{ insights: readonly GovJurisdictionInsight[] }> = ({ insights }) => {\n const grouped = useMemo(\n () =>\n SEVERITY_ORDER.map((severity) => ({\n severity,\n items: insights.filter((insight) => insight.severity === severity),\n })).filter((group) => group.items.length > 0),\n [insights]\n );\n\n if (grouped.length === 0) {\n return (\n <p className=\"text-sm text-text-secondary\">\n No insights yet. They are derived automatically — from trends, targets, budget variance,\n project delays and indicator coverage — as soon as this region has published data to\n compare.\n </p>\n );\n }\n\n return (\n <div className=\"space-y-5\">\n {grouped.map((group) => (\n <section key={group.severity}>\n <h3 className=\"mb-2 text-xs font-semibold uppercase tracking-wide text-text-muted\">\n {SEVERITY_META[group.severity].label} · {formatNumber(group.items.length)}\n </h3>\n <div className=\"space-y-3\">\n {group.items.map((insight, index) => (\n <InsightCard\n key={`${insight.kind}-${insight.indicatorCode ?? index}`}\n insight={insight}\n />\n ))}\n </div>\n </section>\n ))}\n </div>\n );\n};\n\n// ============================================================================\n// Body\n// ============================================================================\n\ninterface ProfileBodyProps {\n overview: GovJurisdictionOverview;\n onNavigate: (relativePath: string) => void;\n}\n\nconst ProfileBody: FC<ProfileBodyProps> = ({ overview, onNavigate }) => {\n const { jurisdiction, currentBudget } = overview;\n const id = jurisdiction.id;\n\n /** Headline numeric facts — only those the region has actually published. */\n const headlineStats = useMemo<SummaryStat[]>(() => {\n const stats: SummaryStat[] = [];\n if (jurisdiction.population != null) {\n stats.push({\n label:\n jurisdiction.populationYear != null\n ? `Population (${jurisdiction.populationYear})`\n : 'Population',\n value: formatNumber(jurisdiction.population),\n icon: <Users />,\n });\n }\n if (jurisdiction.areaSqKm != null) {\n stats.push({\n label: 'Area',\n value: formatNumber(jurisdiction.areaSqKm, { maximumFractionDigits: 1 }),\n hint: 'km²',\n icon: <Ruler />,\n });\n }\n if (jurisdiction.populationDensity != null) {\n stats.push({\n label: 'Population density',\n value: formatNumber(jurisdiction.populationDensity, { maximumFractionDigits: 1 }),\n hint: '/ km²',\n icon: <Gauge />,\n });\n }\n if (jurisdiction.households != null) {\n stats.push({\n label: 'Households',\n value: formatNumber(jurisdiction.households),\n icon: <Home />,\n });\n }\n return stats;\n }, [jurisdiction]);\n\n /** The remaining profile facts, rendered only where a value exists. */\n const profileFacts = useMemo<KeyValueItem[]>(() => {\n const facts: KeyValueItem[] = [];\n if (jurisdiction.establishedOn) {\n facts.push({ label: 'Established', value: formatDate(jurisdiction.establishedOn) });\n }\n if (jurisdiction.headquarters) {\n facts.push({ label: 'Headquarters', value: jurisdiction.headquarters });\n }\n if (jurisdiction.timezone) {\n facts.push({ label: 'Timezone', value: jurisdiction.timezone });\n }\n if (jurisdiction.languages.length > 0) {\n facts.push({ label: 'Languages', value: jurisdiction.languages.join(', ') });\n }\n if (jurisdiction.currencyCode) {\n facts.push({ label: 'Currency', value: jurisdiction.currencyCode });\n }\n if (jurisdiction.officialCode) {\n facts.push({\n label: 'Official code',\n value: <span className=\"font-mono\">{jurisdiction.officialCode}</span>,\n });\n }\n facts.push({ label: 'Country', value: jurisdiction.countryCode });\n if (jurisdiction.publishedAt) {\n facts.push({ label: 'Published', value: formatDate(jurisdiction.publishedAt) });\n }\n if (jurisdiction.sourceName) {\n facts.push({\n label: 'Source',\n value: jurisdiction.sourceUrl ? (\n <a\n href={jurisdiction.sourceUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className=\"text-action-primary-text underline-offset-2 hover:underline\"\n >\n {jurisdiction.sourceName}\n </a>\n ) : (\n jurisdiction.sourceName\n ),\n });\n }\n return facts;\n }, [jurisdiction]);\n\n const emergencyNumbers = useMemo(\n () => parseEmergencyNumbers(jurisdiction.emergencyNumbers),\n [jurisdiction.emergencyNumbers]\n );\n\n const hasContact = Boolean(\n jurisdiction.officialWebsite || jurisdiction.contactEmail || jurisdiction.contactPhone\n );\n\n const quickLinks = useMemo(\n () => [\n {\n key: 'children',\n label: 'Sub-regions',\n count: overview.childCount,\n icon: <Network />,\n to: `intelligence?parentId=${encodeURIComponent(id)}`,\n },\n {\n key: 'officials',\n label: 'Office holders',\n count: overview.officialCount,\n icon: <Users />,\n to: `intelligence/${id}/governance`,\n },\n {\n key: 'projects',\n label: 'Active projects',\n count: overview.activeProjectCount,\n icon: <Wrench />,\n to: `intelligence/${id}/projects`,\n },\n {\n key: 'assets',\n label: 'Public assets',\n count: overview.publicAssetCount,\n icon: <Landmark />,\n to: `intelligence/${id}/assets`,\n },\n {\n key: 'datasets',\n label: 'Published datasets',\n count: overview.publishedDatasetCount,\n icon: <Database />,\n to: `intelligence/${id}/open-data`,\n },\n {\n key: 'consultations',\n label: 'Open consultations',\n count: overview.openConsultationCount,\n icon: <MessageSquare />,\n to: `intelligence/${id}/consultations`,\n },\n ],\n [overview, id]\n );\n\n return (\n <div className=\"space-y-4\">\n {headlineStats.length > 0 && <SummaryStrip stats={headlineStats} />}\n\n {/* Quick links — real counts, each opening the tab that owns them. */}\n <div className=\"grid gap-4 sm:grid-cols-2 xl:grid-cols-3\">\n {quickLinks.map((link) => (\n <MetricsCard\n key={link.key}\n icon={link.icon}\n value={formatNumber(link.count)}\n label={link.label}\n onClick={() => onNavigate(link.to)}\n />\n ))}\n </div>\n\n <p className=\"text-sm text-text-muted\">\n <Users className=\"mr-1.5 inline size-4 align-text-bottom\" aria-hidden=\"true\" />\n <span className=\"font-medium tabular-nums text-text-secondary\">\n {formatNumber(overview.followerCount)}\n </span>{' '}\n {overview.followerCount === 1 ? 'person follows' : 'people follow'} this region.\n </p>\n\n <div className=\"grid gap-4 lg:grid-cols-3\">\n <div className=\"space-y-4 lg:col-span-2\">\n {(jurisdiction.summary || jurisdiction.climateSummary) && (\n <SectionCard title=\"About\" icon={<ScrollText />} className=\"border-border-seam\">\n {jurisdiction.summary && (\n <p className=\"whitespace-pre-wrap text-sm text-text-secondary\">\n {jurisdiction.summary}\n </p>\n )}\n {jurisdiction.climateSummary && (\n <p className=\"mt-3 whitespace-pre-wrap border-t border-border-seam pt-3 text-sm text-text-secondary\">\n <span className=\"font-medium text-text-primary\">Climate: </span>\n {jurisdiction.climateSummary}\n </p>\n )}\n </SectionCard>\n )}\n\n <SectionCard\n title=\"Performance scorecard\"\n icon={<Gauge />}\n className=\"border-border-seam\"\n >\n {overview.scorecard ? (\n <ScorecardPanel scorecard={overview.scorecard} />\n ) : (\n <p className=\"text-sm text-text-secondary\">\n No scorecard yet. One is computed automatically once core indicators are defined and\n this region has published values against them.\n </p>\n )}\n </SectionCard>\n\n <SectionCard title=\"Insights\" icon={<Lightbulb />} className=\"border-border-seam\">\n <InsightsPanel insights={overview.insights} />\n </SectionCard>\n </div>\n\n <div className=\"space-y-4\">\n <SectionCard title=\"Key facts\" icon={<Building2 />} className=\"border-border-seam\">\n {profileFacts.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">No profile details published yet.</p>\n ) : (\n <KeyValueList items={profileFacts} />\n )}\n </SectionCard>\n\n <SectionCard title=\"Contact\" icon={<Phone />} className=\"border-border-seam\">\n {!hasContact && emergencyNumbers.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">\n No contact details have been published for this region yet.\n </p>\n ) : (\n <div className=\"space-y-3\">\n {jurisdiction.officialWebsite && (\n <a\n href={jurisdiction.officialWebsite}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className=\"flex items-center gap-2.5 text-sm text-action-primary-text underline-offset-2 hover:underline\"\n >\n <Globe className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span className=\"min-w-0 truncate\">{jurisdiction.officialWebsite}</span>\n </a>\n )}\n {jurisdiction.contactEmail && (\n <a\n href={`mailto:${jurisdiction.contactEmail}`}\n className=\"flex items-center gap-2.5 text-sm text-action-primary-text underline-offset-2 hover:underline\"\n >\n <Mail className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span className=\"min-w-0 truncate\">{jurisdiction.contactEmail}</span>\n </a>\n )}\n {jurisdiction.contactPhone && (\n <a\n href={`tel:${jurisdiction.contactPhone}`}\n className=\"flex items-center gap-2.5 text-sm text-action-primary-text underline-offset-2 hover:underline\"\n >\n <Phone className=\"size-4 shrink-0\" aria-hidden=\"true\" />\n <span className=\"min-w-0 truncate\">{jurisdiction.contactPhone}</span>\n </a>\n )}\n\n {emergencyNumbers.length > 0 && (\n <div className=\"border-t border-border-seam pt-3\">\n <p className=\"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wide text-text-muted\">\n <Siren className=\"size-3.5\" aria-hidden=\"true\" /> Emergency numbers\n </p>\n <ul className=\"mt-2 space-y-1.5\">\n {emergencyNumbers.map((entry) => (\n <li\n key={`${entry.label}-${entry.number}`}\n className=\"flex items-baseline justify-between gap-4\"\n >\n <span className=\"min-w-0 truncate text-sm text-text-secondary\">\n {entry.label}\n </span>\n <a\n href={`tel:${entry.number}`}\n className=\"shrink-0 text-sm font-semibold tabular-nums text-text-primary underline-offset-2 hover:underline\"\n >\n {entry.number}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )}\n </div>\n )}\n </SectionCard>\n\n {currentBudget && (\n <SectionCard\n title=\"Current budget\"\n icon={<Wallet />}\n className=\"border-border-seam\"\n actions={\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => onNavigate(`intelligence/${id}/budget`)}\n >\n Open\n </Button>\n }\n >\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-sm font-semibold text-text-primary\">\n {currentBudget.fiscalYear}\n </span>\n <StatusBadge status={currentBudget.status} />\n </div>\n <KeyValueList\n className=\"mt-3\"\n items={[\n {\n label: 'Planned revenue',\n value: formatCurrency(\n currentBudget.totalRevenuePlanned,\n currentBudget.currencyCode\n ),\n },\n {\n label: 'Planned expenditure',\n value: formatCurrency(\n currentBudget.totalExpensePlanned,\n currentBudget.currencyCode\n ),\n },\n {\n label: 'Period',\n value: (\n <span className=\"inline-flex items-center gap-1.5\">\n <CalendarDays className=\"size-3.5 text-text-muted\" aria-hidden=\"true\" />\n {formatDate(currentBudget.periodStart)} –{' '}\n {formatDate(currentBudget.periodEnd)}\n </span>\n ),\n },\n ]}\n />\n </SectionCard>\n )}\n </div>\n </div>\n </div>\n );\n};\n\n// ============================================================================\n// Page\n// ============================================================================\n\nexport const JurisdictionProfilePage: FC = () => {\n const { jurisdictionId } = useParams<{ jurisdictionId: string }>();\n const { navigateTo } = useGovCitizenHub();\n\n // Same query key as the layout's read, so this resolves from cache — the\n // profile costs exactly one round trip for the whole screen.\n const {\n data: overview,\n isLoading,\n isError,\n refetch,\n } = useGovJurisdictionOverview(jurisdictionId);\n\n const handleRetry = useCallback(() => {\n void refetch();\n }, [refetch]);\n\n const goToDirectory = useCallback(() => navigateTo('intelligence'), [navigateTo]);\n\n return (\n <JurisdictionLayout>\n {isLoading ? (\n <LoadingView label=\"Loading jurisdiction profile…\" />\n ) : isError ? (\n <ErrorView message=\"We couldn't load this jurisdiction profile.\" onRetry={handleRetry} />\n ) : !overview ? (\n <EmptyState\n illustration=\"empty-search\"\n title=\"Jurisdiction not found\"\n description=\"This region has been removed, or it is not published in this workspace.\"\n action={<Button onClick={goToDirectory}>Browse jurisdictions</Button>}\n />\n ) : (\n <ProfileBody overview={overview} onNavigate={navigateTo} />\n )}\n </JurisdictionLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0FA,IAAM,KAAgB,MAA0B,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,CAAK,CAAC;AAahF,SAAS,EAAsB,GAA6C;CAC1E,IAAI,CAAC,MAAM,QAAQ,CAAG,GAAG,OAAO,CAAC;CACjC,IAAM,IAA4B,CAAC;CACnC,KAAK,IAAM,KAAS,GAAK;EACvB,IAAsB,OAAO,KAAU,aAAnC,KAA+C,MAAM,QAAQ,CAAK,GAAG;EAGzE,IAAM,IAAS,GACT,IAAQ,OAAO,EAAO,SAAU,WAAW,EAAO,MAAM,KAAK,IAAI,IACjE,IACJ,OAAO,EAAO,UAAW,WACrB,EAAO,OAAO,KAAK,IACnB,OAAO,EAAO,UAAW,WACvB,OAAO,EAAO,MAAM,IACpB;EACJ,CAAC,KAAS,CAAC,KACf,EAAO,KAAK;GAAE;GAAO;EAAO,CAAC;CAC/B;CACA,OAAO;AACT;AAEA,IAAM,IAGF;CACF,IAAI;EAAE,MAAM;EAAY,MAAM;EAA4B,OAAO;CAAY;CAC7E,MAAM;EAAE,MAAM;EAAc,MAAM;EAA0B,OAAO;CAAY;CAC/E,MAAM;EAAE,MAAM;EAAO,MAAM;EAAmB,OAAO;CAAO;AAC9D,GAEM,IAAgD;CAAC;CAAQ;CAAU;CAAO;AAAM,GAEhF,IAGF;CACF,MAAM;EACJ,OAAO;EACP,MAAM;EACN,MAAM;CACR;CACA,QAAQ;EACN,OAAO;EACP,MAAM;EACN,MAAM;CACR;CACA,KAAK;EACH,OAAO;EACP,MAAM;EACN,MAAM;CACR;CACA,MAAM;EAAE,OAAO;EAAQ,MAAM;EAA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AQ,SAAS;aAAe;EAA4B,CAAA;CACrE,CAAA,EAIe,CAAA;AAExB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenDataPage.d.ts","sourceRoot":"","sources":["../../../../src/govcitizenhub/pages/intelligence/OpenDataPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAuN7D,wBAAgB,YAAY,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"OpenDataPage.d.ts","sourceRoot":"","sources":["../../../../src/govcitizenhub/pages/intelligence/OpenDataPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAuN7D,wBAAgB,YAAY,IAAI,YAAY,CA0Y3C"}
|
|
@@ -919,7 +919,8 @@ var De = ({ datasetId: e, fallback: t, onClose: ee, onEdit: te, onDelete: o }) =
|
|
|
919
919
|
className: "font-medium",
|
|
920
920
|
children: "exactly one"
|
|
921
921
|
}),
|
|
922
|
-
"
|
|
922
|
+
" ",
|
|
923
|
+
"source: either a file uploaded here, or the publisher’s external URL."
|
|
923
924
|
]
|
|
924
925
|
}),
|
|
925
926
|
C ? /* @__PURE__ */ j("div", {
|