16 lines
328 B
Plaintext
16 lines
328 B
Plaintext
---
|
|
import { Picture } from "@astrojs/image/components";
|
|
|
|
const { src, alt, width, height, ...attrs } = Astro.props;
|
|
---
|
|
|
|
<Picture
|
|
src={src}
|
|
widths={[320, 640, 768]}
|
|
aspectRatio={`${width}:${height}`}
|
|
sizes={`(max-inline-size: ${width}px) 100vw, ${width}px`}
|
|
formats={["avif", "webp"]}
|
|
alt={alt ? alt : ""}
|
|
{...attrs}
|
|
/>
|