Add verified badge top-right on SupplierCard, transport icons on HubCard
Some checks failed
Build Docker Image / build (push) Has been cancelled
Some checks failed
Build Docker Image / build (push) Has been cancelled
This commit is contained in:
@@ -16,8 +16,16 @@
|
|||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<div class="flex flex-col gap-1">
|
<div class="flex flex-col gap-1">
|
||||||
<!-- Title -->
|
<!-- Title + Transport icons -->
|
||||||
<Text size="base" weight="semibold" class="truncate">{{ hub.name }}</Text>
|
<div class="flex items-center justify-between gap-2">
|
||||||
|
<Text size="base" weight="semibold" class="truncate">{{ hub.name }}</Text>
|
||||||
|
<div v-if="hub.transportTypes?.length" class="flex items-center gap-1 shrink-0">
|
||||||
|
<Icon v-if="hasTransport('auto')" name="lucide:truck" size="14" class="text-base-content/50" />
|
||||||
|
<Icon v-if="hasTransport('rail')" name="lucide:train-front" size="14" class="text-base-content/50" />
|
||||||
|
<Icon v-if="hasTransport('sea')" name="lucide:ship" size="14" class="text-base-content/50" />
|
||||||
|
<Icon v-if="hasTransport('air')" name="lucide:plane" size="14" class="text-base-content/50" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!-- Country left, distance right -->
|
<!-- Country left, distance right -->
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<Text tone="muted" size="sm">
|
<Text tone="muted" size="sm">
|
||||||
@@ -41,6 +49,7 @@ interface Hub {
|
|||||||
country?: string | null
|
country?: string | null
|
||||||
countryCode?: string | null
|
countryCode?: string | null
|
||||||
distance?: string
|
distance?: string
|
||||||
|
transportTypes?: string[] | null
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -72,4 +81,6 @@ const countryFlag = computed(() => {
|
|||||||
}
|
}
|
||||||
return '🌍'
|
return '🌍'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const hasTransport = (type: string) => props.hub.transportTypes?.includes(type)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,10 +9,15 @@
|
|||||||
<Card
|
<Card
|
||||||
padding="small"
|
padding="small"
|
||||||
:interactive="linkable || selectable"
|
:interactive="linkable || selectable"
|
||||||
|
class="relative"
|
||||||
:class="[
|
:class="[
|
||||||
isSelected && 'ring-2 ring-primary ring-offset-2'
|
isSelected && 'ring-2 ring-primary ring-offset-2'
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
|
<!-- Verified badge top-right -->
|
||||||
|
<span v-if="supplier.isVerified" class="absolute -top-2 -right-2 badge badge-neutral badge-sm">
|
||||||
|
{{ t('catalogSupplier.badges.verified') }}
|
||||||
|
</span>
|
||||||
<div class="flex flex-col gap-1">
|
<div class="flex flex-col gap-1">
|
||||||
<!-- Logo -->
|
<!-- Logo -->
|
||||||
<div v-if="supplier.logo" class="w-12 h-12 mb-1">
|
<div v-if="supplier.logo" class="w-12 h-12 mb-1">
|
||||||
@@ -25,9 +30,6 @@
|
|||||||
<Text size="base" weight="semibold" class="truncate">{{ supplier.name }}</Text>
|
<Text size="base" weight="semibold" class="truncate">{{ supplier.name }}</Text>
|
||||||
<!-- Badges -->
|
<!-- Badges -->
|
||||||
<div class="flex flex-wrap gap-1">
|
<div class="flex flex-wrap gap-1">
|
||||||
<span v-if="supplier.isVerified" class="badge badge-neutral badge-dash text-xs">
|
|
||||||
{{ t('catalogSupplier.badges.verified') }}
|
|
||||||
</span>
|
|
||||||
<span class="badge badge-neutral badge-dash text-xs">
|
<span class="badge badge-neutral badge-dash text-xs">
|
||||||
{{ reliabilityLabel }}
|
{{ reliabilityLabel }}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user