All checks were successful
Build Docker Image / build (push) Successful in 3m23s
- Add useCatalogSearch composable for managing unified search state - Add UnifiedSearchBar component with token chips for filters - Add CatalogHero component for empty/landing state - Create grid components for each display mode: - CatalogGridProducts, CatalogGridSuppliers, CatalogGridHubs - CatalogGridHubsForProduct, CatalogGridProductsFromSupplier - CatalogGridProductsInHub, CatalogGridOffers - Add unified catalog page at /catalog with query params - Remove SubNavigation from catalog section (kept for other sections) - Update all links to use new unified catalog paths - Delete old nested catalog pages (offers/suppliers/hubs flows) - Add i18n translations for catalog section
64 lines
1.5 KiB
Vue
64 lines
1.5 KiB
Vue
<template>
|
|
<div class="breadcrumbs text-sm">
|
|
<ul>
|
|
<li v-for="(crumb, index) in breadcrumbs" :key="index">
|
|
<NuxtLink v-if="crumb.to" :to="crumb.to" class="hover:text-primary">
|
|
{{ crumb.label }}
|
|
</NuxtLink>
|
|
<span v-else class="text-base-content">{{ crumb.label }}</span>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const props = defineProps<{
|
|
supplierId?: string
|
|
supplierName?: string
|
|
productId?: string
|
|
productName?: string
|
|
hubId?: string
|
|
hubName?: string
|
|
}>()
|
|
|
|
const localePath = useLocalePath()
|
|
const { t } = useI18n()
|
|
|
|
const breadcrumbs = computed(() => {
|
|
const crumbs: Array<{ label: string; to?: string }> = []
|
|
|
|
// Suppliers list
|
|
crumbs.push({
|
|
label: t('breadcrumbs.suppliers', 'Suppliers'),
|
|
to: localePath('/catalog?select=supplier')
|
|
})
|
|
|
|
// Supplier
|
|
if (props.supplierId) {
|
|
const hasNext = props.productId
|
|
crumbs.push({
|
|
label: props.supplierName || `#${props.supplierId.slice(0, 8)}...`,
|
|
to: hasNext ? localePath(`/catalog?supplier=${props.supplierId}`) : undefined
|
|
})
|
|
}
|
|
|
|
// Product
|
|
if (props.productId) {
|
|
const hasNext = props.hubId
|
|
crumbs.push({
|
|
label: props.productName || `#${props.productId.slice(0, 8)}...`,
|
|
to: hasNext ? localePath(`/catalog?supplier=${props.supplierId}&product=${props.productId}`) : undefined
|
|
})
|
|
}
|
|
|
|
// Hub
|
|
if (props.hubId) {
|
|
crumbs.push({
|
|
label: props.hubName || `#${props.hubId.slice(0, 8)}...`
|
|
})
|
|
}
|
|
|
|
return crumbs
|
|
})
|
|
</script>
|