Skip to content

Commit

Permalink
chore: Wrapped graph wrappers in ErrorBoundary
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-hh-aa committed Aug 16, 2024
1 parent a6e2cda commit e6b1651
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 20 deletions.
3 changes: 3 additions & 0 deletions app/components/graphs/LifetimeFairholdLandPurchaseWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import React from "react";
import ErrorBoundary from '../ErrorBoundary';
import { Household } from "@/app/models/Household";
import LifetimeCombinedChart from "./LifetimeCombinedChart";

Expand Down Expand Up @@ -43,10 +44,12 @@ const LifetimeFairholdLandPurchaseWrapper: React.FC<Props> = ({
) ?? [];

return (
<ErrorBoundary>
<div>
<h2>Lifetime Costs Chart</h2>
<LifetimeCombinedChart data={chartData} colorScheme={colorScheme} />
</div>
</ErrorBoundary>
);
};

Expand Down
11 changes: 7 additions & 4 deletions app/components/graphs/LifetimeFairholdLandRentWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import React from "react";
import ErrorBoundary from '../ErrorBoundary';
import { Household } from "@/app/models/Household";
import LifetimeCombinedChart from "./LifetimeCombinedChart";
interface Props {
Expand Down Expand Up @@ -38,10 +39,12 @@ const LifetimeFairholdLandRentWrapper: React.FC<Props> = ({ household }) => {
}) ?? [];

return (
<div>
<h2>Lifetime Costs Chart</h2>
<LifetimeCombinedChart data={chartData} colorScheme={colorScheme} />
</div>
<ErrorBoundary>
<div>
<h2>Lifetime Costs Chart</h2>
<LifetimeCombinedChart data={chartData} colorScheme={colorScheme} />
</div>
</ErrorBoundary>
);
};

Expand Down
11 changes: 7 additions & 4 deletions app/components/graphs/LifetimeMarketPurchaseWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import React from "react";
import ErrorBoundary from '../ErrorBoundary';
import { Household } from "@/app/models/Household";
import LifetimeCombinedChart from "./LifetimeCombinedChart";

Expand Down Expand Up @@ -39,10 +40,12 @@ const LifetimeMarketPurchaseWrapper: React.FC<Props> = ({ household }) => {
}) ?? [];

return (
<div>
<h2>Lifetime Costs Chart</h2>
<LifetimeCombinedChart data={chartData} colorScheme={colorScheme} />
</div>
<ErrorBoundary>
<div>
<h2>Lifetime Costs Chart</h2>
<LifetimeCombinedChart data={chartData} colorScheme={colorScheme} />
</div>
</ErrorBoundary>
);
};

Expand Down
11 changes: 7 additions & 4 deletions app/components/graphs/LifetimeMarketRentWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import React from "react";
import ErrorBoundary from '../ErrorBoundary';
import { Household } from "@/app/models/Household";
import LifetimeCombinedChart from "./LifetimeCombinedChart";

Expand Down Expand Up @@ -38,10 +39,12 @@ const LifetimeMarketRentWrapper: React.FC<Props> = ({ household }) => {
}) ?? [];

return (
<div>
<h2>Lifetime Costs Chart</h2>
<LifetimeCombinedChart data={chartData} colorScheme={colorScheme} />
</div>
<ErrorBoundary>
<div>
<h2>Lifetime Costs Chart</h2>
<LifetimeCombinedChart data={chartData} colorScheme={colorScheme} />
</div>
</ErrorBoundary>
);
};

Expand Down
11 changes: 7 additions & 4 deletions app/components/graphs/TenureComparisonWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import React from "react";
import ErrorBoundary from '../ErrorBoundary';
import { Household } from "@/app/models/Household";
import TenureComparisonBarChart from "./TenureComparisonBarChart";

Expand Down Expand Up @@ -58,10 +59,12 @@ const TenureComparisonWrapper: React.FC<TenureComparisonWrapperProps> = ({
const formattedData = formatData(household);

return (
<div>
<h2>Tenure Comparison Chart</h2>
<TenureComparisonBarChart data={formattedData} />
</div>
<ErrorBoundary>
<div>
<h2>Tenure Comparison Chart</h2>
<TenureComparisonBarChart data={formattedData} />
</div>
</ErrorBoundary>
);
};

Expand Down
11 changes: 7 additions & 4 deletions app/components/graphs/TotalPaymentWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import React from "react";
import ErrorBoundary from '../ErrorBoundary';
import { Household } from "@/app/models/Household";
import TotalPaymentBarChart from "./TotalPaymentBarChart";

Expand Down Expand Up @@ -55,10 +56,12 @@ const TotalPaymentWrapper: React.FC<TotalPaymentWrapperProps> = ({
];

return (
<div>
<h2>Total Payments Chart</h2>
<TotalPaymentBarChart data={chartData} />
</div>
<ErrorBoundary>
<div>
<h2>Total Payments Chart</h2>
<TotalPaymentBarChart data={chartData} />
</div>
</ErrorBoundary>
);
};

Expand Down

0 comments on commit e6b1651

Please sign in to comment.