import type { DialogProps } from "../../../core/types"; import type { UserProfile } from "../../../core/types"; import { MaterialDialog } from "../core/Dialog"; import { formatTime } from "../../../utils/utils"; import defaultAvatar from "../../../resources/images/default-avatar.png"; interface UserProfileDialogProps extends DialogProps { userProfile: UserProfile | null; } export function UserProfileDialog({ isOpen, onOpenChange, userProfile }: UserProfileDialogProps) { const content = userProfile ? (
Profile Picture { const target = e.target as HTMLImageElement; target.src = defaultAvatar; }} />

{userProfile.username}

{userProfile.online ? ( <> Online ) : ( <> Last seen {formatTime(userProfile.last_seen)} )}
{userProfile.bio || "No bio available."}
Member since: {formatTime(userProfile.created_at)}
Last seen: {formatTime(userProfile.last_seen)}
Send Message
) : null return ( {content} ); }