From 5b2668c4d9b0930b27f4aa374e3ad0aaa518fb53 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Wed, 17 Apr 2024 01:51:57 +0200 Subject: [PATCH] fix type --- .../pages/part/pricing/BomPricingPanel.tsx | 20 +++++++++++++++---- .../src/pages/part/pricing/PricingPanel.tsx | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx b/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx index b8228b0334..e431905eb6 100644 --- a/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx +++ b/src/frontend/src/pages/part/pricing/BomPricingPanel.tsx @@ -37,7 +37,13 @@ import { InvenTreeTable } from '../../../tables/InvenTreeTable'; import { NoPricingData } from './PricingPanel'; // Display BOM data as a pie chart -function BomPieChart({ data, currency }: { data: any[]; currency: string }) { +function BomPieChart({ + data, + currency +}: { + readonly data: any[]; + readonly currency: string; +}) { return ( @@ -78,7 +84,13 @@ function BomPieChart({ data, currency }: { data: any[]; currency: string }) { } // Display BOM data as a bar chart -function BomBarChart({ data, currency }: { data: any[]; currency: string }) { +function BomBarChart({ + data, + currency +}: { + readonly data: any[]; + readonly currency: string; +}) { return ( @@ -113,8 +125,8 @@ export default function BomPricingPanel({ part, pricing }: { - part: any; - pricing: any; + readonly part: any; + readonly pricing: any; }): ReactNode { const table = useTable('pricing-bom'); diff --git a/src/frontend/src/pages/part/pricing/PricingPanel.tsx b/src/frontend/src/pages/part/pricing/PricingPanel.tsx index de9dac2bfe..f3ffdf7739 100644 --- a/src/frontend/src/pages/part/pricing/PricingPanel.tsx +++ b/src/frontend/src/pages/part/pricing/PricingPanel.tsx @@ -43,9 +43,9 @@ export default function PricingPanel({ label: panelOptions; title: string; visible: boolean; - disabled?: boolean | undefined; + disabled?: boolean; }): ReactNode { - const is_disabled = disabled === undefined ? false : disabled; + const is_disabled = disabled ?? false; return ( visible && (