wip: browse user

This commit is contained in:
Ren Amamiya
2023-09-22 14:13:55 +07:00
parent 18a9ba3fb0
commit c9bc7b81dd
10 changed files with 229 additions and 11 deletions

View File

@@ -20,7 +20,15 @@ export const User = memo(function User({
}: {
pubkey: string;
time?: number;
variant?: 'default' | 'simple' | 'mention' | 'repost' | 'chat' | 'large' | 'thread';
variant?:
| 'default'
| 'simple'
| 'mention'
| 'repost'
| 'chat'
| 'large'
| 'thread'
| 'avatar';
embedProfile?: string;
}) {
const { status, user } = useProfile(pubkey, embedProfile);
@@ -125,6 +133,16 @@ export const User = memo(function User({
);
}
if (variant === 'avatar') {
return (
<Image
src={user?.picture || user?.image}
alt={pubkey}
className="h-12 w-12 shrink-0 rounded-lg object-cover"
/>
);
}
if (variant === 'repost') {
return (
<>