feat: some shit?
Some checks failed
Deploy to SFTP Server / build (push) Failing after 50m12s

This commit is contained in:
2024-04-07 00:29:52 +02:00
parent 96c053d5ff
commit f76477db98
11 changed files with 57 additions and 46 deletions

View File

@@ -5,6 +5,7 @@ import { generateThumbHash } from "@helpers/image";
interface Props {
src: ImageMetadata;
alt: string;
pictureClass?: string;
class?: string;
caption?: string;
hash?: boolean;
@@ -12,7 +13,14 @@ interface Props {
maxWidth?: number;
}
const { src: image, loader = true, hash = true, alt, maxWidth } = Astro.props;
const {
src: image,
loader = true,
pictureClass = "",
hash = true,
alt,
maxWidth,
} = Astro.props;
let thumbhash = hash ? await generateThumbHash(image) : "";
@@ -40,7 +48,7 @@ const sizes = [
alt={alt}
data-thumbhash={thumbhash}
pictureAttributes={{
class: `${hash ? "block h-full relative" : ""} ${loader ? "thumb" : ""}`,
class: `${hash ? "block h-full relative" : ""} ${loader ? "thumb" : ""} ${pictureClass}`,
}}
class={Astro.props.class}
widths={sizes.map((size) => size.width)}