@for (_ of [1,2,3,4,5,6,7,8]; track $index) {
-
+
}
} @else if (products.length > 0) {
@@ -28,9 +32,26 @@
(compareToggled)="compareToggled.emit($event)"
(shareRequested)="shareRequested.emit($event)" />
} @else {
-
-
{{ 'catalog.emptyResultsTitle' | translate }}
-
{{ 'catalog.emptyResultsDescription' | translate }}
+
+ @if (queryTooShort) {
+
+
+
+ } @else if (searchQuery) {
+
+
+
+ } @else {
+
+
+
+ }
}
diff --git a/src/app/features/website/catalog/components/search-results/search-results.component.scss b/src/app/features/website/catalog/components/search-results/search-results.component.scss
index 8f5fe2b..2226a2a 100644
--- a/src/app/features/website/catalog/components/search-results/search-results.component.scss
+++ b/src/app/features/website/catalog/components/search-results/search-results.component.scss
@@ -28,31 +28,18 @@
.skeleton-card {
min-height: 340px;
+ display: grid;
+ gap: 10px;
+ padding: 16px;
border: 1px solid var(--border-color);
border-radius: var(--radius-lg, 13px);
- background:
- linear-gradient(90deg, #edf1f1 25%, #e2ebea 50%, #edf1f1 75%) 16px 16px / calc(100% - 32px) calc(100% - 32px) no-repeat,
- var(--bg-secondary);
- background-size: 200% 100%;
- animation: shimmer 1.2s linear infinite;
+ background: var(--bg-secondary);
}
-.empty-state {
+.results-empty-state {
min-height: 180px;
display: grid;
place-content: center;
- gap: 6px;
- text-align: center;
- padding: 18px;
-}
-
-.empty-state h3,
-.empty-state p {
- margin: 0;
-}
-
-.empty-state p {
- color: var(--text-secondary);
}
.results-pager {
@@ -109,7 +96,3 @@
text-align: center;
}
}
-
-@keyframes shimmer {
- to { background-position: -200% 0; }
-}
diff --git a/src/app/features/website/catalog/components/search-results/search-results.component.ts b/src/app/features/website/catalog/components/search-results/search-results.component.ts
index bc3cd1e..59f57b5 100644
--- a/src/app/features/website/catalog/components/search-results/search-results.component.ts
+++ b/src/app/features/website/catalog/components/search-results/search-results.component.ts
@@ -3,11 +3,14 @@ import { Product } from '../../../../../core/products/models/product-domain.mode
import { CatalogLayoutMode } from '../../../../../core/products/models/catalog-experience.model';
import { CatalogProductGridComponent } from '../product-grid/product-grid.component';
import { TranslatePipe } from '../../../../../i18n/translate.pipe';
+import { EmptyStateComponent } from '../../../../../shared/ui/empty-state/empty-state.component';
+import { IconComponent } from '../../../../../shared/ui/icon/icon.component';
+import { SkeletonComponent } from '../../../../../shared/ui/skeleton/skeleton.component';
@Component({
selector: 'app-catalog-search-results',
standalone: true,
- imports: [CatalogProductGridComponent, TranslatePipe],
+ imports: [CatalogProductGridComponent, TranslatePipe, EmptyStateComponent, IconComponent, SkeletonComponent],
templateUrl: './search-results.component.html',
styleUrls: ['./search-results.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
@@ -28,6 +31,9 @@ export class CatalogSearchResultsComponent {
@Input() comparedIds: number[] = [];
@Input() loadingStrategy: 'pagination' | 'loadMore' | 'infiniteScroll' = 'pagination';
@Input() hasMore = false;
+ @Input() searchQuery = '';
+ @Input() queryTooShort = false;
+ @Input() minSearchLength = 3;
@Output() pageChange = new EventEmitter
();
@Output() loadMore = new EventEmitter();
diff --git a/src/app/features/website/catalog/containers/catalog-container.component.html b/src/app/features/website/catalog/containers/catalog-container.component.html
index 442c3dd..777d9a6 100644
--- a/src/app/features/website/catalog/containers/catalog-container.component.html
+++ b/src/app/features/website/catalog/containers/catalog-container.component.html
@@ -31,7 +31,7 @@
@for (saved of savedSearches(); track saved.id) {
}
@@ -172,7 +172,10 @@
[showAvailability]="features().availability"
[showShareAction]="features().share"
[favoriteIds]="favoriteIds()"
- [comparedIds]="comparedIds()" />
+ [comparedIds]="comparedIds()"
+ [searchQuery]="state().search"
+ [queryTooShort]="isQueryTooShort()"
+ [minSearchLength]="minSearchLength" />
} @else if (isEmptyCategoryState()) {