diff --git a/packages/cccv/index.scss b/packages/cccv/index.scss index 8a0f93f2..13100026 100644 --- a/packages/cccv/index.scss +++ b/packages/cccv/index.scss @@ -36,10 +36,14 @@ caption { @apply font-source-sans-3 text-[16px] leading-[22px] text-textCaption; } -button { +.button-style { @apply font-source-sans-3 text-nui font-bold text-[16px] leading-[22px] border-2 rounded-3xl pl-4 border-nui pr-4 pt-2 pb-2; } +button { + @apply button-style; +} + button:hover { @apply font-source-sans-3 text-white bg-nui font-bold text-[16px] leading-[22px]; } diff --git a/packages/cccv/package.json b/packages/cccv/package.json index 345fc742..8dfea33a 100644 --- a/packages/cccv/package.json +++ b/packages/cccv/package.json @@ -17,7 +17,7 @@ "@heroicons/react": "^2.1.3", "@lingui/react": "^4.11.1", "@material-tailwind/react": "^2.1.9", - "@react-pdf/renderer": "^3.4.5", + "@react-pdf/renderer": "^4.0.0", "@tanstack/react-query": "^5.28.8", "@turf/turf": "^7.1.0", "@types/lodash": "^4.17.0", diff --git a/packages/cccv/src/components/FreshwaterManagementUnit/FreshwaterManagementUnit.tsx b/packages/cccv/src/components/FreshwaterManagementUnit/FreshwaterManagementUnit.tsx index a609a849..09dc3612 100644 --- a/packages/cccv/src/components/FreshwaterManagementUnit/FreshwaterManagementUnit.tsx +++ b/packages/cccv/src/components/FreshwaterManagementUnit/FreshwaterManagementUnit.tsx @@ -1,23 +1,38 @@ -import "./FreshwaterManagementUnit.scss"; -import purify from "dompurify"; -import {Key} from "react"; -import { FmuFullDetailsWithMap } from "@models/FreshwaterManagementUnit.ts"; -import { PDFDownloadLink } from "@react-pdf/renderer"; -import { FreshwaterManagementUnitPDF } from "@components/FreshwaterManagementUnit/FreshwaterManagementUnit.pdf"; -import formatFilename from "@lib/formatAsFilename"; -import dateTimeString from "@lib/dateTimeString"; -import { ContaminantList, contaminants as fmuContaminants } from "@components/FreshwaterManagementUnit/utils.ts"; -import EmailLink from "@components/EmailLink/EmailLink.tsx"; -import { Contaminants } from "@components/Contaminants/Contaminants.tsx"; -import makeSafe from "@lib/makeSafe.ts"; -import {parseHtmlListToArray} from "@lib/parseHtmlListToArray.ts"; +import "./FreshwaterManagementUnit.scss" +import purify from "dompurify" +import { Key, useEffect, useState, useMemo } from "react" +import { FmuFullDetailsWithMap } from "@models/FreshwaterManagementUnit.ts" +import {usePDF, UsePDFInstance} from "@react-pdf/renderer" +import { FreshwaterManagementUnitPDF } from "@components/FreshwaterManagementUnit/FreshwaterManagementUnit.pdf" +import formatFilename from "@lib/formatAsFilename" +import dateTimeString from "@lib/dateTimeString" +import { ContaminantList, contaminants as fmuContaminants } from "@components/FreshwaterManagementUnit/utils.ts" +import EmailLink from "@components/EmailLink/EmailLink.tsx" +import { Contaminants } from "@components/Contaminants/Contaminants.tsx" +import makeSafe from "@lib/makeSafe.ts" +import { parseHtmlListToArray } from "@lib/parseHtmlListToArray.ts" +import { Spinner } from "@components/LoadingIndicator/LoadingIndicatorOverlay" -const FreshwaterManagementUnit = (details: FmuFullDetailsWithMap) => { +interface DownloadLinkProps { + pdfLoading: boolean; + instance: UsePDFInstance; + fileName: string; + hasError?: boolean; +} - if (!details?.freshwaterManagementUnit) { - return
This area contains sites of significance to Tangata Whenua including:
The content, data, and information used in this app comes from multiple sources, including Greater - Wellington’s Natural Resources Plan (2018) and Whaitua Implementation Plans.
++ The content, data, and information used in this app comes from multiple sources, including Greater + Wellington’s Natural Resources Plan (2018) and Whaitua Implementation Plans. +