|
97 | 97 | </div> |
98 | 98 | </div> |
99 | 99 | <div class="grid grid-cols-3 gap-4"> |
100 | | - <div |
101 | | - v-for="node in products" |
102 | | - :key="node.id" |
103 | | - class="group cursor-pointer rounded-2xl dark:bg-secondary-bg-d hover:dark:bg-[#222222] px-4 pt-4 pb-3 transition ease-[ease] duration-300 dark:border-[#222222] hover:dark:border-[#303030] border"> |
104 | | - <div class="relative mb-4 pb-[133%] dark:shadow-[0_8px_24px_rgba(0,0,0,.5)] rounded-lg overflow-hidden"> |
105 | | - <NuxtImg |
106 | | - loading="lazy" |
107 | | - :title="node.name" |
108 | | - :alt="node.image.altText || node.name" |
109 | | - :src="node.galleryImages.nodes[0].sourceUrl" |
110 | | - class="absolute h-full w-full dark:bg-neutral-800 bg-neutral-200 object-cover" /> |
111 | | - <NuxtImg |
112 | | - loading="lazy" |
113 | | - :title="node.name" |
114 | | - :alt="node.image.altText || node.name" |
115 | | - :src="node.image.sourceUrl" |
116 | | - class="absolute h-full w-full dark:bg-neutral-800 bg-neutral-200 object-cover transition-opacity duration-300 group-hover:opacity-0" /> |
117 | | - </div> |
118 | | - <div class="mb-1 grid grid-flow-col gap-6 px-2 text-sm font-semibold"> |
119 | | - <div class="flex min-w-0 flex-col justify-between gap-1"> |
120 | | - <div class="text-xs text-secondary-text dark:text-secondary-text-d transition-all hover:text-black hover:dark:text-neutral-100"> |
121 | | - {{ node.allPaUrunTipi.nodes[0].name }} |
122 | | - </div> |
123 | | - <div :title="node.name" class="overflow-hidden text-ellipsis whitespace-nowrap"> |
124 | | - {{ node.name }} |
125 | | - </div> |
126 | | - </div> |
127 | | - <div class="flex flex-col gap-1 text-right"> |
128 | | - <div class="text-xs text-secondary-text dark:text-secondary-text-d line-through" v-html="node.regularPrice"></div> |
129 | | - <div class="font-bold text-[#d9000c] dark:text-[#ff0000]" v-html="node.salePrice"></div> |
130 | | - </div> |
131 | | - </div> |
132 | | - </div> |
| 100 | + <ProductCard v-for="product in products" :key="product.id" :product="product" /> |
133 | 101 | <ProductSkeleton v-if="loading" /> |
134 | 102 | </div> |
135 | | - <div v-if="!empty && !loading" class="p-6 text-center text-lg"> |
136 | | - <Icon name="majesticons:search-line" size="99"></Icon> |
137 | | - <div class="py-4"> |
138 | | - <span v-if="selectedCategory"> |
139 | | - In the <strong>{{ selectedCategory }}</strong> category, |
140 | | - </span> |
141 | | - <span v-if="searchTerm"> |
142 | | - there are no items matching for: <strong>{{ searchTerm }}</strong> |
143 | | - </span> |
144 | | - </div> |
145 | | - <div class="text-sm">Try improving your results by double checking your spelling or trying a more general keyword.</div> |
146 | | - </div> |
| 103 | + <ProductEmpty v-if="!empty && !loading" :cat="selectedCategory" :term="searchTerm" /> |
147 | 104 | <Footer /> |
148 | 105 | </div> |
149 | 106 | </div> |
150 | 107 | </template> |
151 | 108 |
|
152 | | -<script setup lang="ts"> |
| 109 | +<script setup> |
153 | 110 | const { products, empty, loading, categories, options, searchTerm, selectedCategory, selectedOption, isDropdownCategory, isDropdownSortBy } = useSearch(); |
154 | 111 | </script> |
155 | 112 |
|
|
0 commit comments