feat: implement cart icon component with quantity badge and integrate into store header for improved UI

This commit is contained in:
2026-07-02 09:27:01 -03:00
parent 8a6ed763df
commit 16eea32ce7
12 changed files with 266 additions and 36 deletions

View File

@@ -0,0 +1,19 @@
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
@Component({
selector: 'app-cart-icon',
imports: [],
templateUrl: './cart-icon.component.html',
styleUrl: './cart-icon.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CartIconComponent {
readonly quantity = input<number | null | undefined>(undefined);
readonly disabled = input(false);
readonly ariaLabel = input<string>('Carrito de compras');
protected readonly hasQuantity = computed(() => {
const q = this.quantity();
return q !== null && q !== undefined && q > 0;
});
}