fwt/src/templates/components/Image/Image.tsx
2025-08-28 17:41:46 +08:00

18 lines
393 B
TypeScript

interface Props {
avif: string
webp: string
size?: number
alt?: string
}
export default (props: Props) => {
return (
<>
<picture>
<source srcset={props.avif} type="image/avif" />
<source srcset={props.webp} type="image/webp" />
<img width={props.size} height="auto" decoding="async" loading="lazy" alt={props.alt} />
</picture>
</>
)
}