feat: enhance DetailSparepart component with image upload and preview functionality

This commit is contained in:
2025-11-27 11:36:23 +07:00
parent afcb85a323
commit 572042ab53
2 changed files with 88 additions and 83 deletions

View File

@@ -91,7 +91,7 @@ const SparepartCardList = ({
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
justifyContent: 'flex-start',
padding: '16px 8px',
height: '100%',
}}
@@ -100,7 +100,7 @@ const SparepartCardList = ({
<Tag
color="blue"
style={{
marginBottom: '12px',
marginBottom: '8px',
}}
>
{item.sparepart_item_type}
@@ -162,7 +162,7 @@ const SparepartCardList = ({
{item[header]}
</Title>
<Text type="secondary">
Available: {item.sparepart_stok || '0'}
Available Stock: {item.sparepart_stok || '0'}
</Text>
<Divider style={{ margin: '8px 0' }} />
@@ -171,16 +171,16 @@ const SparepartCardList = ({
icon={<MinusOutlined />}
onClick={() => handleQuantityChange(item.sparepart_id, quantity - 1)}
disabled={isLoading}
type="text"
style={{ width: 28, height: 28 }}
/>
<Text strong style={{ padding: '0 16px', fontSize: '16px' }}>{quantity}</Text>
<Text strong style={{ padding: '0 8px', fontSize: '16px' }}>{quantity}</Text>
<Button
icon={<PlusOutlined />}
onClick={() => handleQuantityChange(item.sparepart_id, quantity + 1)}
disabled={isLoading}
type="text"
style={{ width: 28, height: 28 }}
/>
<Text type="secondary" style={{ marginLeft: '8px' }}>{item.sparepart_unit || 'pcs'}</Text>
<Text type="secondary">{item.sparepart_unit ? ` / ${item.sparepart_unit}` : ' / pcs'}</Text>
</Space>
<Button