demo box component

This commit is contained in:
Oliver Bryan
2025-09-29 20:57:53 +01:00
parent 593d6d979f
commit c09ede18f8

26
src/components/Demo.astro Normal file
View File

@@ -0,0 +1,26 @@
---
interface Props {
image: string;
title: string;
type?: "boxed" | "simple";
}
const { image, title, type = "simple" } = Astro.props;
---
{type === "boxed" ? (
<div class="border demo-border">
<span>{title}</span>
<img
src={image}
alt={title}
class="object-cover"
/>
</div>
) : (
<img
src={image}
alt={title}
class="w-full h-full object-cover demo-border"
/>
)}