feat: some shit

This commit is contained in:
Max Richter
2025-10-25 17:02:05 +02:00
parent d62cdc7986
commit f3918a460c
5 changed files with 31 additions and 20 deletions

View File

@@ -85,7 +85,7 @@ const sizes = thumbnail
pictureAttributes={{
class: `${hash ? "block h-full relative" : ""} ${loader ? "thumb" : ""} ${pictureClass}`,
}}
class={Astro.props.class}
class={`${Astro.props.class} h-full w-full`}
widths={sizes.map((size) => size.width)}
sizes={sizes
.map((size) => `${size.media || "100vw"} ${size.width}px`)

View File

@@ -5,6 +5,13 @@ import Image from "@components/Image.astro";
import type { ImageMetadata } from "astro";
const { resource } = Astro.props;
function formatRating(rating: string | number) {
if (typeof rating === "number") {
return "⭐".repeat(rating);
}
return rating;
}
---
<div>
@@ -21,8 +28,13 @@ const { resource } = Astro.props;
/>
)
}
<h1 class="text-4xl mb-4">{resource?.content?.itemReviewed?.name || "Unknown Name"}</h1>
{ resource?.content?.reviewRating?.ratingValue !== undefined && <div>{resource?.content?.reviewRating?.ratingValue}</div>}
<h1 class="text-4xl mb-4">
{resource?.content?.itemReviewed?.name || "Unknown Name"}
</h1>
{
resource?.content?.reviewRating?.ratingValue !== undefined && (
<div>{formatRating(resource?.content?.reviewRating?.ratingValue)}</div>
)
}
<div set:html={markdownToHtml(resource?.content?.reviewBody)} />
</div>