webapp/src/components/_shared/Image/Image.tsx
2023-03-24 20:36:43 +01:00

9 lines
282 B
TypeScript

import { splitProps } from 'solid-js'
import type { JSX } from 'solid-js'
export const Image = (props: JSX.ImgHTMLAttributes<HTMLImageElement>) => {
const [local, others] = splitProps(props, ['src'])
return <img src={`/api/image?url=${encodeURI(local.src)}`} {...others} />
}