mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-19 05:30:44 -05:00
39 lines
642 B
TypeScript
39 lines
642 B
TypeScript
export function Image({
|
|
path,
|
|
alt,
|
|
title,
|
|
className,
|
|
width,
|
|
height,
|
|
style,
|
|
}: {
|
|
path: string;
|
|
alt: string;
|
|
title?: string;
|
|
className?: string;
|
|
width?: number;
|
|
height?: number;
|
|
style?: React.CSSProperties;
|
|
}) {
|
|
return (
|
|
<picture title={title}>
|
|
<source
|
|
type="image/avif"
|
|
srcSet={`${path}.avif`}
|
|
className={className}
|
|
width={width}
|
|
height={height}
|
|
style={style}
|
|
/>
|
|
<img
|
|
alt={alt}
|
|
src={`${path}.png`}
|
|
className={className}
|
|
width={width}
|
|
height={height}
|
|
style={style}
|
|
/>
|
|
</picture>
|
|
);
|
|
}
|