All checks were successful
Update Memento Dev on VPS / deploy (push) Successful in 8m55s
Reviewed-on: #15 Co-authored-by: GauthierWebDev <gauthier@gauthierdaniels.fr> Co-committed-by: GauthierWebDev <gauthier@gauthierdaniels.fr>
18 lines
401 B
TypeScript
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}
|
|
/>
|
|
);
|
|
}
|