refactor(app): tighten feature boundaries

This commit is contained in:
2026-06-30 14:50:31 +08:00
parent 1fed21fa2f
commit ba6ce57e62
17 changed files with 126 additions and 52 deletions
-1
View File
@@ -25,6 +25,5 @@ export * from "./private-message-card";
export * from "./pwa-install-dialog";
export * from "./pwa-install-overlay";
export * from "./text-bubble";
export * from "./user-message-avatar";
export * from "./voice-bubble";
export * from "./voice-unlock-options-dialog";
+1 -1
View File
@@ -1,7 +1,7 @@
"use client";
import Image from "next/image";
import { UserMessageAvatar } from "./user-message-avatar";
import { UserMessageAvatar } from "@/app/_components";
import styles from "./message-avatar.module.css";
export interface MessageAvatarProps {
@@ -1,47 +0,0 @@
"use client";
import Image from "next/image";
import styles from "./message-avatar.module.css";
export interface UserMessageAvatarProps {
avatarUrl?: string | null;
className?: string;
size?: number;
}
export function UserMessageAvatar({
avatarUrl,
className,
size = 43,
}: UserMessageAvatarProps) {
const avatarClassName = [styles.avatar, className].filter(Boolean).join(" ");
const avatarStyle = { width: size, height: size };
if (avatarUrl && avatarUrl.length > 0) {
return (
<div
className={avatarClassName}
style={avatarStyle}
aria-label="User avatar"
>
<Image src={avatarUrl} alt="" width={size} height={size} />
</div>
);
}
return (
<div
className={avatarClassName}
style={avatarStyle}
aria-label="Guest avatar"
>
<Image
src="/images/chat/pic-chat-guest.png"
alt="Guest"
width={size}
height={size}
/>
</div>
);
}