<div class="flex flex-col gap-3 flex-wrap">
  @if (loading()) {
    @for (_ of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15]; track $index) {
      <div class="w-100 h-12">
        <p-skeleton width="100%" height="100%"></p-skeleton>
      </div>
    }
  } @else {
    @for (good of visibleGoods(); track good.id) {
      <div class="flex items-center bg-surface-card rounded-lg p-1 shadow-xs gap-2">
        <div class="grow flex items-center gap-2">
          <img
            [src]="good.image_url || goodPlaceholder"
            loading="lazy"
            decoding="async"
            class="w-12 h-12 object-cover rounded-md"
          />
          <div class="flex flex-col gap-2">
            <span class="text-lg font-bold">
              {{ good.name }}
              @if (!good.is_default_guild_good) {
                <small class="text-xs text-muted-color">*</small>
              }
            </span>
            <span class="text-sm text-muted-color">
              {{ good.sku.code }}
            </span>
          </div>
        </div>
        <div class="shrink-0 flex items-center justify-between gap-3">
          <button pButton type="button" icon="pi pi-plus" size="small" (click)="addGood(good)">انتخاب</button>
        </div>
      </div>
    }
    @if (hasMore()) {
      <button pButton type="button" outlined class="mx-auto" (click)="loadMore()">نمایش کالاهای بیشتر</button>
    }
  }
</div>
