mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
Fixing build errors
This commit is contained in:
parent
0c080595a4
commit
edfeba043f
4 changed files with 15 additions and 12 deletions
|
|
@ -20,6 +20,12 @@ import {
|
|||
|
||||
import type { EpcBandCount, AgeBandCount, PropertyTypeCount } from "./types";
|
||||
|
||||
const friendlyKeys = {
|
||||
actual: "Actual EPCs",
|
||||
estimated: "Estimated EPCs",
|
||||
scenario: "Scenario result",
|
||||
};
|
||||
|
||||
export function BreakdownChart({
|
||||
epcBands,
|
||||
ageBands,
|
||||
|
|
@ -33,12 +39,6 @@ export function BreakdownChart({
|
|||
}) {
|
||||
const [selected, setSelected] = useState("epc");
|
||||
|
||||
const friendlyKeys = {
|
||||
actual: "Actual EPCs",
|
||||
estimated: "Estimated EPCs",
|
||||
scenario: "Scenario result",
|
||||
};
|
||||
|
||||
const chartData = useMemo(() => {
|
||||
if (selected !== "epc") {
|
||||
return selected === "age"
|
||||
|
|
@ -73,7 +73,7 @@ export function BreakdownChart({
|
|||
}
|
||||
|
||||
return rows;
|
||||
}, [selected, epcBands, ageBands, propertyTypes, scenarioEpcBands]);
|
||||
}, [selected, epcBands, ageBands, propertyTypes, scenarioEpcBands, friendlyKeys.actual, friendlyKeys.estimated, friendlyKeys.scenario]);
|
||||
|
||||
const categories =
|
||||
selected === "epc"
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ export function ScenarioMeasuresModal({
|
|||
data,
|
||||
error,
|
||||
}: ScenarioMeasuresModalProps) {
|
||||
const measures: ScenarioMeasure[] = data?.measures ?? [];
|
||||
const measures = useMemo<ScenarioMeasure[]>(() => data?.measures ?? [], [data?.measures]);
|
||||
|
||||
const grouped = useMemo(() => groupMeasuresByCategory(measures), [measures]);
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ function EmptyPropertyState() {
|
|||
<div className="text-center text-gray-400">
|
||||
<HomeIcon className="h-16 w-16 mx-auto mb-4 text-gray-200" />
|
||||
<p>
|
||||
Hover over <strong>"New Property"</strong> to start adding properties
|
||||
Hover over <strong>“New Property”</strong> to start adding properties
|
||||
to your portfolio.
|
||||
</p>
|
||||
</div>
|
||||
|
|
@ -388,7 +388,7 @@ export default function PropertyTable({
|
|||
filterGroups: allFilterGroups,
|
||||
});
|
||||
|
||||
const queryData = filteredResponse?.data ?? [];
|
||||
const queryData = useMemo(() => filteredResponse?.data ?? [], [filteredResponse?.data]);
|
||||
const filteredTotal = filteredResponse?.total ?? 0;
|
||||
|
||||
// Second query for total (no filters) — React Query dedupes when filters are empty
|
||||
|
|
@ -412,7 +412,10 @@ export default function PropertyTable({
|
|||
rows: PropertyWithRelations[];
|
||||
}>({ filterKey: "", rows: [] });
|
||||
|
||||
const extraRows = extraState.filterKey === filterKey ? extraState.rows : [];
|
||||
const extraRows = useMemo(
|
||||
() => (extraState.filterKey === filterKey ? extraState.rows : []),
|
||||
[extraState, filterKey],
|
||||
);
|
||||
|
||||
// The full data visible to the table — initial batch + any lazy-loaded rows
|
||||
const tableData = useMemo(
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export default function SuccessToast({
|
|||
}, timeoutMs);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, [show, onClose]);
|
||||
}, [show, onClose, showConfetti, timeoutMs]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue