Unify offers UI to OfferResultCard and require price
All checks were successful
Build Docker Image / build (push) Successful in 5m59s

This commit is contained in:
Ruslan Bakiev
2026-02-05 19:12:39 +07:00
parent beb02bd3fc
commit 0f0b1db394
6 changed files with 58 additions and 144 deletions

View File

@@ -81,15 +81,18 @@
<!-- Offers Tab -->
<div v-else-if="activeTab === 'offers'" class="space-y-2">
<OfferCard
v-for="(offer, index) in offers"
<OfferResultCard
v-for="(offer, index) in offersWithPrice"
:key="offer.uuid ?? index"
:offer="offer"
selectable
:is-selected="selectedItemId === offer.uuid"
:location-name="offer.locationName || offer.locationCountry"
:product-name="offer.productName"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
:currency="offer.currency"
:unit="offer.unit"
:stages="[]"
@select="$emit('select', offer, 'offer')"
/>
<div v-if="offers.length === 0" class="text-center text-base-content/50 py-8">
<div v-if="offersWithPrice.length === 0" class="text-center text-base-content/50 py-8">
{{ t('catalogMap.empty.offers') }}
</div>
</div>
@@ -136,7 +139,7 @@ interface Offer {
validUntil?: string | null
}
defineProps<{
const props = defineProps<{
activeTab: 'hubs' | 'suppliers' | 'offers'
hubs: Hub[]
suppliers: Supplier[]
@@ -152,4 +155,8 @@ defineEmits<{
const localePath = useLocalePath()
const { t } = useI18n()
const offersWithPrice = computed(() =>
(props.offers || []).filter(o => o?.pricePerUnit != null)
)
</script>