Unify offers UI to OfferResultCard and require price
All checks were successful
Build Docker Image / build (push) Successful in 5m59s
All checks were successful
Build Docker Image / build (push) Successful in 5m59s
This commit is contained in:
@@ -14,14 +14,14 @@
|
||||
<span class="loading loading-spinner loading-md text-white" />
|
||||
</div>
|
||||
|
||||
<div v-else-if="offers.length === 0" class="text-center py-8 text-white/60">
|
||||
<div v-else-if="offersWithPrice.length === 0" class="text-center py-8 text-white/60">
|
||||
<Icon name="lucide:search-x" size="32" class="mb-2" />
|
||||
<p>{{ $t('catalog.empty.noOffers') }}</p>
|
||||
</div>
|
||||
|
||||
<div v-else class="flex flex-col gap-2">
|
||||
<div
|
||||
v-for="offer in offers"
|
||||
v-for="offer in offersWithPrice"
|
||||
:key="offer.uuid"
|
||||
class="cursor-pointer"
|
||||
@click="emit('select-offer', offer)"
|
||||
@@ -54,12 +54,16 @@ interface Offer {
|
||||
locationCountryCode?: string | null
|
||||
}
|
||||
|
||||
defineProps<{
|
||||
const emit = defineEmits<{
|
||||
'select-offer': [offer: Offer]
|
||||
}>()
|
||||
|
||||
const props = defineProps<{
|
||||
loading: boolean
|
||||
offers: Offer[]
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'select-offer': [offer: Offer]
|
||||
}>()
|
||||
const offersWithPrice = computed(() =>
|
||||
(props.offers || []).filter(o => o?.pricePerUnit != null)
|
||||
)
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user