dasig-solid/frontend/@dasig/components/Image.tsx
2025-11-28 11:17:23 +08:00

19 lines
558 B
TypeScript

/** biome-ignore-all lint/complexity/noUselessFragments: <_> */
interface Props {
name: string
size?: number
radius?: number | 0
}
export default (props: Props) => {
return (
<>
<picture>
<source srcset={`./@dasig/images/${props.name}.avif`} type="image/avif" />
<source srcset={`./@dasig/images/${props.name}.webp`} type="image/webp" />
<img style={`border-radius: ${props.radius}rem`} width={props.size} height="auto" decoding="async" loading="lazy" alt={props.name + ' image'} />
</picture>
</>
)
}