<!-- Сетка карточек каналов, 2-4 колонки -->
<template>
  <div
    id="anchor"
    class="grid-channels"
  >
    <CardChannel
      v-for="(item, index) in items"
      :key="item.guid"
      :card="item"
      :priority="priority && index === 0"
      class="grid-channels__card"
    />
  </div>
</template>

<script setup lang="ts">
import type { IChannelCard } from '../../types';

defineProps<{
  items: IChannelCard[]
  priority?: boolean
}>();
</script>

<style lang="scss">
.grid-channels {
  display: grid;
  gap: 24px;

  @include from-br(xs) {
    grid-template-columns: repeat(2, 1fr);
  }

  @include from-br(sm) {
    grid-template-columns: repeat(3, 1fr);
  }

  @include from-br(md) {
    grid-template-columns: repeat(4, 1fr);
  }
}
</style>
