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

@@ -38,16 +38,17 @@
<!-- Offers Tab -->
<template v-if="activeTab === 'offers'">
<OfferResultCard
v-for="(offer, index) in offers"
v-for="(offer, index) in offersWithPrice"
:key="offer.uuid ?? index"
:location-name="offer.locationName"
:product-name="offer.title || undefined"
:product-name="offer.productName || offer.title || undefined"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
:currency="offer.currency"
:unit="offer.unit"
:stages="[]"
:start-name="offer.locationName || undefined"
:end-name="undefined"
@select="selectOffer(offer)"
/>
<Text v-if="offers.length === 0" tone="muted" size="sm" class="text-center py-4">
<Text v-if="offersWithPrice.length === 0" tone="muted" size="sm" class="text-center py-4">
{{ t('catalogMap.empty.offers') }}
</Text>
</template>
@@ -83,10 +84,14 @@ interface Hub {
interface Offer {
uuid?: string | null
title?: string | null
productName?: string | null
locationName?: string | null
status?: string | null
latitude?: number | null
longitude?: number | null
pricePerUnit?: number | string | null
currency?: string | null
unit?: string | null
}
interface Supplier {
@@ -114,9 +119,13 @@ const selectedId = ref<string | null>(null)
const { t } = useI18n()
const offersWithPrice = computed(() =>
(props.offers || []).filter(o => o?.pricePerUnit != null)
)
const tabs = computed(() => [
{ id: 'hubs' as const, label: 'catalogMap.tabs.hubs', count: props.hubs.length },
{ id: 'offers' as const, label: 'catalogMap.tabs.offers', count: props.offers.length },
{ id: 'offers' as const, label: 'catalogMap.tabs.offers', count: offersWithPrice.value.length },
{ id: 'suppliers' as const, label: 'catalogMap.tabs.suppliers', count: props.suppliers.length }
])