18 lines
393 B
TypeScript
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>
|
|
</>
|
|
)
|
|
}
|