2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-18 18:28:18 +00:00

Allocate Stock tweaks (#10618)

- Display IPN
- Display part units
This commit is contained in:
Oliver
2025-10-19 11:59:35 +11:00
committed by GitHub
parent 73ca468ff7
commit 2b1fd1c309
2 changed files with 13 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
import { Progress, Stack, Text } from '@mantine/core';
import { Group, Progress, Stack, Text } from '@mantine/core';
import { useMemo } from 'react';
import { formatDecimal } from '../functions/Formatting';
@@ -9,6 +9,7 @@ export type ProgressBarProps = {
progressLabel?: boolean;
animated?: boolean;
size?: string;
units?: string;
};
/**
@@ -30,9 +31,12 @@ export function ProgressBar(props: Readonly<ProgressBarProps>) {
return (
<Stack gap={2} style={{ flexGrow: 1, minWidth: '100px' }}>
{props.progressLabel && (
<Text ta='center' size='xs'>
{formatDecimal(props.value)} / {formatDecimal(props.maximum)}
</Text>
<Group gap='xs' justify='center'>
<Text ta='center' size='xs'>
{formatDecimal(props.value)} / {formatDecimal(props.maximum)}
</Text>
{props.units && <Text size='xs'>[{props.units}]</Text>}
</Group>
)}
<Progress
value={progress}