---
import Text from "./StrapiBlockTextItem.astro";
import type { StrapiBlockTextItem, StrapiBlockTextNodePartial } from "../../../types";



type Props = {
    url: string;
    class?: string;
    data: Array<StrapiBlockTextItem>;
    theme: StrapiBlockTextNodePartial;
};

const { data, url, class: classes = "", theme = {} as StrapiBlockTextNodePartial } = Astro.props;

---

{
    url && (
        <a
            class={classes}
            href={url}
        >
            {data.map((item: StrapiBlockTextItem) => (
                <Text data={item} theme={theme} />
            ))}
        </a>
    )
}
