import { Avatar, Badge, Group, Paper, Stack, Text } from "@mantine/core"; import type { TracearrHistorySession } from "@homarr/integrations/types"; import { useScopedI18n } from "@homarr/translation/client"; export function RecentActivityList({ sessions }: { sessions: TracearrHistorySession[] }) { const t = useScopedI18n("widget.tracearr"); return ( {t("recentActivity.title")} {sessions.length === 0 ? ( {t("recentActivity.empty")} ) : ( {sessions.map((session) => { const mediaLabel = session.mediaType === "episode" && session.showTitle ? `${session.showTitle} - S${session.seasonNumber ?? 0}E${session.episodeNumber ?? 0}` : session.mediaTitle; return ( {mediaLabel} {session.user.username} • {session.serverName} {session.watched ? t("recentActivity.watched") : t("recentActivity.partial")} {new Date(session.startedAt).toLocaleDateString()} ); })} )} ); }