diff --git a/src/components/ImageWithLightbox/index.tsx b/src/components/ImageWithLightbox/index.tsx
index dd96f2ac..c9871072 100644
--- a/src/components/ImageWithLightbox/index.tsx
+++ b/src/components/ImageWithLightbox/index.tsx
@@ -13,13 +13,15 @@ import Image from '../Image'
export default function ImageWithLightbox({
image,
className,
- classNames = {}
+ classNames = {},
+ errorPlaceholder
}: {
image: TImetaInfo
className?: string
classNames?: {
wrapper?: string
}
+ errorPlaceholder?: string
}) {
const id = useMemo(() => `image-with-lightbox-${randomString()}`, [])
const { t } = useTranslation()
@@ -67,6 +69,7 @@ export default function ImageWithLightbox({
}}
image={image}
onClick={(e) => handlePhotoClick(e)}
+ errorPlaceholder={errorPlaceholder}
/>
{index >= 0 &&
createPortal(
diff --git a/src/components/Profile/AvatarWithLightbox.tsx b/src/components/Profile/AvatarWithLightbox.tsx
new file mode 100644
index 00000000..7685f7d0
--- /dev/null
+++ b/src/components/Profile/AvatarWithLightbox.tsx
@@ -0,0 +1,32 @@
+import { Skeleton } from '@/components/ui/skeleton'
+import { useFetchProfile } from '@/hooks'
+import { generateImageByPubkey } from '@/lib/pubkey'
+import { useMemo } from 'react'
+import ImageWithLightbox from '../ImageWithLightbox'
+
+export default function AvatarWithLightbox({ userId }: { userId: string }) {
+ const { profile } = useFetchProfile(userId)
+ const defaultAvatar = useMemo(
+ () => (profile?.pubkey ? generateImageByPubkey(profile.pubkey) : ''),
+ [profile]
+ )
+
+ if (!profile) {
+ return (
+