refactor(ui): extract auth and avatar components
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
"use client";
|
||||
|
||||
import Image from "next/image";
|
||||
|
||||
import styles from "./message-avatar.module.css";
|
||||
|
||||
export interface UserMessageAvatarProps {
|
||||
avatarUrl?: string | null;
|
||||
}
|
||||
|
||||
export function UserMessageAvatar({ avatarUrl }: UserMessageAvatarProps) {
|
||||
if (avatarUrl && avatarUrl.length > 0) {
|
||||
return (
|
||||
<div className={styles.avatar} aria-label="User avatar">
|
||||
<Image src={avatarUrl} alt="" width={43} height={43} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.avatar} aria-label="Guest avatar">
|
||||
<Image
|
||||
src="/images/chat/pic-chat-guest.png"
|
||||
alt="Guest"
|
||||
width={43}
|
||||
height={43}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user