@@ -72,6 +72,18 @@
|
||||
{{ expiryText }}
|
||||
</UBadge>
|
||||
</div>
|
||||
|
||||
<!-- Low Stock Warning -->
|
||||
<div v-if="isLowStock" class="text-xs">
|
||||
<UBadge
|
||||
color="orange"
|
||||
variant="soft"
|
||||
class="w-full justify-center"
|
||||
>
|
||||
<UIcon name="i-heroicons-exclamation-triangle" class="mr-1" />
|
||||
Low stock ({{ item.quantity }}/{{ item.low_stock_threshold }})
|
||||
</UBadge>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
@@ -145,4 +157,10 @@ const expiryText = computed(() => {
|
||||
if (daysUntilExpiry.value === 1) return 'Expires tomorrow'
|
||||
return `Expires in ${daysUntilExpiry.value} days`
|
||||
})
|
||||
|
||||
// Low stock detection
|
||||
const isLowStock = computed(() => {
|
||||
if (!props.item.low_stock_threshold) return false
|
||||
return Number(props.item.quantity) <= Number(props.item.low_stock_threshold)
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user