import { Link } from 'react-router-dom' import { FileText, Zap, PenTool, LayoutGrid, ChevronRight } from 'lucide-react' import type { CreateType } from '../../data/createData' import type { DocumentRecord } from '../../lib/documents' import { formatRelativeTime, getActivityDate, getProjectColor, getProjectIcon, typeColors, typeLabels, } from '../../lib/documentUtils' const typeIcons: Record = { silo: FileText, shed: Zap, sketch: PenTool, stead: LayoutGrid, } function getActionLabel(doc: DocumentRecord): string { const created = new Date(doc.createdAt).getTime() const updated = new Date(doc.updatedAt).getTime() if (Math.abs(updated - created) < 5000) { return `Created by ${doc.createdBy}` } return `Updated by ${doc.createdBy}` } interface RecentActivitiesProps { documents: DocumentRecord[] loading?: boolean onViewAll?: () => void } export default function RecentActivities({ documents, loading, onViewAll, }: RecentActivitiesProps) { const items = documents.slice(0, 8) return (

Recent Activities

{items.length > 0 && ( )}
{loading ? ( ) : items.length === 0 ? (
No activity yet. Create a Silo, Sketch, Shed, or Stead to get started.
) : ( )} {items.length > 0 && ( )}
) }