2024-10-06 11:41:27 +02:00
|
|
|
---
|
|
|
|
import ProjectCard from "./ProjectCard.astro"
|
|
|
|
import * as m from "@/paraglide/messages"
|
2024-10-20 12:05:32 +02:00
|
|
|
import { type CollectionEntry } from "astro:content"
|
|
|
|
import { type NavLink } from "@/utils/linking"
|
2024-10-06 11:41:27 +02:00
|
|
|
|
|
|
|
interface Props {
|
2024-10-20 12:05:32 +02:00
|
|
|
projects: CollectionEntry<"projects">[]
|
2024-10-06 11:41:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const { projects } = Astro.props
|
2024-10-20 12:05:32 +02:00
|
|
|
|
|
|
|
const baseUrl: NavLink = "/projects"
|
2024-10-06 11:41:27 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
<h1 class="text-4xl font-bold text-center sm:my-10 mt-2">{m.myProjects()}</h1>
|
|
|
|
<div class="flex flex-wrap justify-around">
|
|
|
|
{
|
|
|
|
projects.map(
|
|
|
|
({
|
|
|
|
data: { title, description, tags, heroImage, heroImageAlt },
|
2024-10-20 12:05:32 +02:00
|
|
|
id
|
2024-10-06 11:41:27 +02:00
|
|
|
}) => (
|
|
|
|
<div class="my-5 px-2">
|
|
|
|
<ProjectCard
|
|
|
|
title={title}
|
2024-10-20 12:05:32 +02:00
|
|
|
linkTo={`${baseUrl}/${id}`}
|
2024-10-06 11:41:27 +02:00
|
|
|
description={description}
|
|
|
|
tags={tags}
|
|
|
|
image={heroImage}
|
|
|
|
imageAlt={heroImageAlt}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
</div>
|