memorium/components/Image.tsx

27 lines
496 B
TypeScript
Raw Normal View History

2023-08-09 13:32:28 +02:00
import { asset } from "$fresh/runtime.ts";
2023-08-08 21:55:10 +02:00
import * as CSS from "https://esm.sh/csstype@3.1.2";
2023-08-08 21:50:23 +02:00
2023-08-08 21:55:10 +02:00
const Image = (
props: {
class: string;
src: string;
alt?: string;
width?: number | string;
height?: number | string;
style?: CSS.HtmlAttributes;
},
) => {
2023-08-08 21:50:23 +02:00
return (
2023-08-08 21:55:10 +02:00
<img
alt={props.alt}
style={props.style}
2023-08-09 13:32:28 +02:00
src={asset(props.src)}
2023-08-08 21:55:10 +02:00
width={props.width}
height={props.height}
class={props.class}
/>
2023-08-08 21:50:23 +02:00
);
2023-08-08 21:55:10 +02:00
};
export default Image;