"use client"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { cn, getInitials, formatRelativeDate } from "@/lib/utils"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Film, MessageSquare, CheckCircle2, XCircle, Upload, Bell, AtSign, } from "lucide-react"; interface ActivityItem { id: string; type: string; title: string; message: string; createdAt: Date; user?: { name: string | null; image: string | null; } | null; } interface RecentActivityProps { activities: ActivityItem[]; } const ACTIVITY_ICONS: Record = { VERSION_UPLOADED: { icon: Upload, color: "text-blue-400 bg-blue-500/10" }, FEEDBACK_ADDED: { icon: MessageSquare, color: "text-amber-400 bg-amber-500/10" }, SHOT_APPROVED: { icon: CheckCircle2, color: "text-emerald-400 bg-emerald-500/10" }, SHOT_REJECTED: { icon: XCircle, color: "text-red-400 bg-red-500/10" }, COMMENT_REPLY: { icon: MessageSquare, color: "text-purple-400 bg-purple-500/10" }, MENTION: { icon: AtSign, color: "text-primary bg-primary/10" }, REVISION_REQUESTED: { icon: Film, color: "text-orange-400 bg-orange-500/10" }, }; export function RecentActivity({ activities }: RecentActivityProps) { if (activities.length === 0) { return (

No recent activity

); } return (
{activities.map((item) => { const cfg = ACTIVITY_ICONS[item.type] ?? { icon: Bell, color: "text-muted-foreground bg-muted/20" }; const Icon = cfg.icon; return (

{item.title}

{item.message}

{item.user && ( {item.user.image && } {getInitials(item.user.name)} )} {formatRelativeDate(item.createdAt)}
); })}
); }