memento-dev/app/components/Image.tsx
GauthierWebDev 068b2dc44d
All checks were successful
Update Memento Dev on VPS / deploy (push) Successful in 8m55s
rework/lightweight (#15)
Reviewed-on: #15
Co-authored-by: GauthierWebDev <gauthier@gauthierdaniels.fr>
Co-committed-by: GauthierWebDev <gauthier@gauthierdaniels.fr>
2025-04-21 17:12:22 +00:00

18 lines
401 B
TypeScript

import type { JSX } from "solid-js";
type ImageProps = JSX.IntrinsicElements["img"] & { src: string; alt: string };
export default function Image(props: ImageProps) {
const isDecorationImage = props.alt === "";
return (
<img
loading="lazy"
{...props}
src={props.src}
aria-hidden={isDecorationImage ? "true" : undefined}
alt={isDecorationImage ? undefined : props.alt}
/>
);
}