---
// Import necessary components and utilities
import Layout from "../layouts/Layout.astro";
import { getCollection } from "astro:content";
import PoleElementsList from "../components/PoleElementsList.astro";
import { getStrapiBaseUrl } from "../config/strapi";

// Fetch all posts from Strapi using Astro's content collection
const strapiPoleElements = await getCollection("poleElements");
// Get Strapi URL from global config
const BASE_URL = getStrapiBaseUrl();
---

<Layout title="Pole Elements" description="Pole Elements">
	<!-- Main heading -->
	<h1 class="text-3xl font-bold mb-8">
		Pole Elements
	</h1>
	<!-- Pole Elements List -->
	<PoleElementsList 
		elements={strapiPoleElements}
		class="max-w-4xl mx-auto space-y-4"
		id="pole-elements-list"
		data-testid="pole-elements"
	/>
</Layout>
