import { formatDistanceToNow } from "date-fns"; import { History, LogIn, LogOut, UserPlus, ShieldCheck, Key, FolderPlus, GitCommit, GitPullRequest, AlertCircle, Settings, Image as ImageIcon, } from "lucide-react"; import type { UserActivityItem } from "@/client/model"; import { Skeleton } from "@/components/ui/skeleton"; interface ActivityTimelineProps { items: UserActivityItem[]; isLoading?: boolean; } const ICON_MAP: Record = { login: LogIn, logout: LogOut, register: UserPlus, password_change: ShieldCheck, ssh_key_add: Key, project_create: FolderPlus, commit: GitCommit, pull_request_create: GitPullRequest, issue_create: AlertCircle, profile_update: Settings, avatar_upload: ImageIcon, }; export function ActivityTimeline({ items, isLoading }: ActivityTimelineProps) { if (isLoading) { return (
); } if (items.length === 0) { return (

No recent activity

); } return (
); }