add image component

This commit is contained in:
Ren Amamiya
2023-05-04 22:34:15 +07:00
parent aa6b1bdc62
commit b377846073
25 changed files with 80 additions and 56 deletions

9
src/shared/image.tsx Normal file
View File

@@ -0,0 +1,9 @@
import { DEFAULT_AVATAR } from '@lume/stores/constants';
export const Image = (props) => {
const addImageFallback = (event) => {
event.currentTarget.src = DEFAULT_AVATAR;
};
return <img {...props} loading="lazy" decoding="async" onError={addImageFallback} />;
};