This commit is contained in:
Matthias Mair 2024-04-17 01:51:57 +02:00
parent 9f16d3f957
commit 5b2668c4d9
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
2 changed files with 18 additions and 6 deletions

View File

@ -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 (
<ResponsiveContainer width="100%" height={500}>
<PieChart>
@ -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 (
<ResponsiveContainer width="100%" height={500}>
<BarChart data={data}>
@ -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');

View File

@ -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 && (
<Accordion.Item value={label} id={label}>