--- // Import the necessary types and assets import type { Comic } from '../lib/types'; import { Image } from 'astro:assets'; interface Props { comic: Comic; } const { comic } = Astro.props; const coverUrl = comic.md_comics.md_covers[0] ? `https://meo.comick.pictures/${comic.md_comics.md_covers[0].b2key}` : '/placeholder.png'; // Determine if the file is AVIF based on the URL const isAvif = comic.md_comics.md_covers[0]?.b2key.endsWith('.avif'); // Define standard image dimensions const IMG_WIDTH = 250; const IMG_HEIGHT = 350; // Generate optimized image URL with dimensions const optimizedCoverUrl = coverUrl.includes('meo.comick.pictures') ? `${coverUrl}?width=${IMG_WIDTH}&quality=80` : coverUrl; ---
{!isAvif ? ( {comic.md_comics.title} ) : ( {comic.md_comics.title} { e.currentTarget.src = '/placeholder.png'; }} /> )}

{comic.md_comics.title}

Chapter {comic.chap}

{new Date(comic.updated_at).toLocaleString(undefined, { timeStyle: "short" })}