2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00
This commit is contained in:
Matthias Mair
2024-04-17 01:51:57 +02:00
parent 9f16d3f957
commit 5b2668c4d9
2 changed files with 18 additions and 6 deletions

View File

@ -37,7 +37,13 @@ import { InvenTreeTable } from '../../../tables/InvenTreeTable';
import { NoPricingData } from './PricingPanel'; import { NoPricingData } from './PricingPanel';
// Display BOM data as a pie chart // 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 ( return (
<ResponsiveContainer width="100%" height={500}> <ResponsiveContainer width="100%" height={500}>
<PieChart> <PieChart>
@ -78,7 +84,13 @@ function BomPieChart({ data, currency }: { data: any[]; currency: string }) {
} }
// Display BOM data as a bar chart // 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 ( return (
<ResponsiveContainer width="100%" height={500}> <ResponsiveContainer width="100%" height={500}>
<BarChart data={data}> <BarChart data={data}>
@ -113,8 +125,8 @@ export default function BomPricingPanel({
part, part,
pricing pricing
}: { }: {
part: any; readonly part: any;
pricing: any; readonly pricing: any;
}): ReactNode { }): ReactNode {
const table = useTable('pricing-bom'); const table = useTable('pricing-bom');

View File

@ -43,9 +43,9 @@ export default function PricingPanel({
label: panelOptions; label: panelOptions;
title: string; title: string;
visible: boolean; visible: boolean;
disabled?: boolean | undefined; disabled?: boolean;
}): ReactNode { }): ReactNode {
const is_disabled = disabled === undefined ? false : disabled; const is_disabled = disabled ?? false;
return ( return (
visible && ( visible && (
<Accordion.Item value={label} id={label}> <Accordion.Item value={label} id={label}>