This commit is contained in:
Ren Amamiya
2023-05-26 09:28:49 +07:00
parent 225179dd6d
commit 5c7b18bf29
41 changed files with 404 additions and 461 deletions

View File

@@ -1,15 +1,16 @@
import { Image } from "@shared/image";
import { DEFAULT_AVATAR } from "@stores/constants";
import { useProfile } from "@utils/hooks/useProfile";
export default function ActiveAccount({ user }: { user: any }) {
const userData = JSON.parse(user.metadata);
export default function ActiveAccount({ data }: { data: any }) {
const { user } = useProfile(data.npub);
return (
<button type="button" className="relative h-11 w-11 overflow-hidden">
<Image
src={userData.picture || DEFAULT_AVATAR}
alt="user's avatar"
src={user?.picture || DEFAULT_AVATAR}
alt={data.npub}
className="h-11 w-11 rounded-md object-cover"
/>
</button>