'use client'; import { Memory } from '@/types/memory'; import { getCategoryColor, getTypeColor } from '@/lib/category-colors'; function relativeTime(dateStr: string): string { const diff = Date.now() - new Date(dateStr).getTime(); const mins = Math.floor(diff / 60000); if (mins < 1) return 'now'; if (mins < 60) return `${mins}m ago`; const hrs = Math.floor(mins / 60); if (hrs < 24) return `${hrs}h ago`; const days = Math.floor(hrs / 24); if (days < 7) return `${days}d ago`; const weeks = Math.floor(days / 7); return `${weeks}w ago`; } interface MemoryCardProps { memory: Memory; isSelected: boolean; onSelect: (m: Memory) => void; isChecked?: boolean; onCheck?: (id: number, checked: boolean) => void; } export function MemoryCard({ memory, isSelected, onSelect, isChecked, onCheck }: MemoryCardProps) { const catColor = getCategoryColor(memory.category); const typeColor = getTypeColor(memory.type); return (
{memory.content}
{/* Tags */} {memory.tags.length > 0 && (