feat: update quantity display and stock update button visibility in SparepartCardList component
This commit is contained in:
@@ -298,7 +298,6 @@ const SparepartCardList = ({
|
||||
>
|
||||
{item[header]}
|
||||
</Title>
|
||||
<Text type="secondary">Qty: {item.sparepart_qty || 0}</Text>
|
||||
<Text type="secondary" style={{ display: 'block' }}>
|
||||
Stok: {item.sparepart_stok || 'Not Available'}
|
||||
</Text>
|
||||
@@ -309,9 +308,9 @@ const SparepartCardList = ({
|
||||
style={{
|
||||
marginBottom: '8px',
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
>
|
||||
<Text type="secondary">Qty</Text>
|
||||
<Button
|
||||
icon={<MinusOutlined />}
|
||||
onClick={() =>
|
||||
@@ -327,7 +326,7 @@ const SparepartCardList = ({
|
||||
strong
|
||||
style={{ padding: '0 8px', fontSize: '16px' }}
|
||||
>
|
||||
{quantity}
|
||||
{item.sparepart_qty + (quantity || 0)}
|
||||
</Text>
|
||||
<Button
|
||||
icon={<PlusOutlined />}
|
||||
@@ -347,15 +346,17 @@ const SparepartCardList = ({
|
||||
</Text>
|
||||
</Space>
|
||||
|
||||
<Button
|
||||
type={quantity === 0 ? 'default' : 'primary'}
|
||||
size="small"
|
||||
style={{ width: '100%' }}
|
||||
onClick={() => handleUpdateStock(item)}
|
||||
loading={isLoading}
|
||||
>
|
||||
Update Stock
|
||||
</Button>
|
||||
{quantity !== 0 && (
|
||||
<Button
|
||||
type={quantity === 0 ? 'default' : 'primary'}
|
||||
size="small"
|
||||
style={{ width: '100%' }}
|
||||
onClick={() => handleUpdateStock(item)}
|
||||
loading={isLoading}
|
||||
>
|
||||
Update Stock
|
||||
</Button>
|
||||
)}
|
||||
|
||||
<br />
|
||||
<Text
|
||||
|
||||
Reference in New Issue
Block a user