diff options
Diffstat (limited to 'bskyogcard/src/components/Img.tsx')
-rw-r--r-- | bskyogcard/src/components/Img.tsx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bskyogcard/src/components/Img.tsx b/bskyogcard/src/components/Img.tsx new file mode 100644 index 000000000..dac223180 --- /dev/null +++ b/bskyogcard/src/components/Img.tsx @@ -0,0 +1,10 @@ +import React from 'react' + +export function Img( + props: Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'src'> & {src: Buffer}, +) { + const {src, ...others} = props + return ( + <img {...others} src={`data:image/jpeg;base64,${src.toString('base64')}`} /> + ) +} |