webapp/src/components/_shared/Image/Image.tsx

9 lines
282 B
TypeScript
Raw Normal View History

2023-03-24 14:51:05 +00:00
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} />
}