<template>
  <div class="flex flex-row flex-wrap gap-2 w-full min-h-fit">
    <NuxtPicture
      v-for="img in data?.images"
      loading="lazy"
      class="max-sm:w-full sm:h-48 object-cover object-center"
      :src="baseUrl + img.url"
      :imgAttrs="{ class: 'max-sm:w-full sm:h-48 object-cover object-center' }"
    />
  </div>
</template>

<script setup lang="ts">
import type { PropType } from "vue";
import type DynamicZoneGallery from "~~/types/component/dynamic-zone/gallery";

const runtimeConfig = useRuntimeConfig();
const baseUrl = runtimeConfig.public.strapi.url;

defineProps({
  data: Object as PropType<DynamicZoneGallery>,
});
</script>
