"use client"; import Image from "next/image"; import { avatarImageUrl } from "@/lib/format"; export interface OnlineUser { id: number; username: string; look: string; roomId: number | null; roomName: string | null; lastActivity: Date; } /** Live list of online users with room and activity tracking */ export function OnlineUsersWidget({ users, isLoading = false, }: { users: OnlineUser[]; isLoading?: boolean; }) { const formatLastSeen = (date: Date) => { const now = new Date(); const diff = Math.floor((now.getTime() - date.getTime()) / 1000); if (diff < 60) return "Just now"; if (diff < 3600) return `${Math.floor(diff / 60)}m ago`; if (diff < 86400) return `${Math.floor(diff / 3600)}h ago`; return `${Math.floor(diff / 86400)}d ago`; }; return (