martials.no/src/components/projects/ProjectCard.astro

36 lines
865 B
Plaintext
Raw Normal View History

2024-09-25 22:20:47 +02:00
---
import { Image } from "astro:assets"
import { type ImageMetadata } from "astro"
import BadgeList from "../badge/BadgeList.astro"
import LocaleLink from "../links/LocaleLink.astro"
import { type NavLink } from "@/utils/linking"
2024-09-25 22:20:47 +02:00
interface Props {
title: string
description: string
tags: string[]
image: ImageMetadata
imageAlt: string
linkTo: NavLink
2024-09-25 22:20:47 +02:00
}
const { title, description, tags, image, imageAlt, linkTo } = Astro.props
---
<LocaleLink
to={linkTo}
class="card bg-cat-base max-w-96 shadow-xl hover:scale-105 transition border border-cat-surface0"
2024-09-25 22:20:47 +02:00
>
<figure>
<Image src={image} alt={imageAlt} />
<figcaption class="sr-only">{imageAlt}</figcaption>
2024-09-25 22:20:47 +02:00
</figure>
<div class="card-body text-cat-text">
2024-09-25 22:20:47 +02:00
<h2 class="card-title">
{title}
</h2>
<p>{description}</p>
<BadgeList tags={tags} />
</div>
</LocaleLink>