---
import Layout from "../../layouts/Layout.astro";
import "../../styles/global.css";
import fetchApi from "../../lib/strapi";
import type Company from "../../interfaces/company";
import { Image } from "astro:assets";
export async function getStaticPaths() {
const companies = await fetchApi<Company[]>({
endpoint: 'companies',
wrappedByKey: 'data',
});
return companies.map((company) => ({
params: { slug: company.slug },
props: company,
}));
}
type Props = Company;
const company = Astro.props;
const STRAPI_URL = "http://localhost:1337";
const workImages: any[] = company.work;
console.log(workImages);
---
<Layout title={`${company.name} | Graphic Designer`}>
<main id="company">
<div class="wrapper">
<h1 class="title company__name">{company.name}</h1>
<p class="description company__description">{company.description}</p>
<div class="company__images">
{company.work?.map((work) => (
<Image
src={`${STRAPI_URL}${work.url}`}
alt={work.alternativeText}
width="500"
height="700"
/>
))}
</div>
</div>
</main>
</Layout>
<style>
</style>
If you try this code (with an added console.log), what does it show in your server console (not the browser)?