<script setup lang="ts">
/**
 * Backward-compatibility shim for `configuration-block.elements-block`.
 *
 * New schemas should use `card.list` directly. This component delegates
 * entirely to ListCard so existing JSON continues to render correctly
 * without any migration required.
 */
import ListCard from "@/components/compositions/elements/card/ListCard.vue"

export interface ElementsBlockProps {
  label?: string
  name?: string | null
  nestedElements?: Array<Record<string, unknown>>
  item?: Record<string, unknown>
  classList?: string[] | string
  showCard?: boolean
  title?: string
  subtitle?: string
  gutterY?: string
  gutterX?: string
}

const props = withDefaults(defineProps<ElementsBlockProps>(), {
  label: "Elements Block",
  showCard: true,
  nestedElements: () => [],
  item: () => ({}),
})
</script>

<template>
  <ListCard
    :label="props.label"
    :title="props.title"
    :subtitle="props.subtitle"
    :show-card="props.showCard"
    :gutter-y="props.gutterY"
    :gutter-x="props.gutterX"
    :nested-elements="props.nestedElements"
    :item="props.item"
    :class-list="props.classList"
    :data-element-name="props.name ?? undefined"
  />
</template>
