'use client' import React from 'react' import type { ProjectInfo } from '@/lib/sdk/types' export function formatTimeAgo(dateStr: string): string { if (!dateStr) return '' const date = new Date(dateStr) if (isNaN(date.getTime())) return '' const now = Date.now() const diff = now - date.getTime() const seconds = Math.floor(diff / 1000) if (seconds < 60) return 'Gerade eben' const minutes = Math.floor(seconds / 60) if (minutes < 60) return `vor ${minutes} Min` const hours = Math.floor(minutes / 60) if (hours < 24) return `vor ${hours} Std` const days = Math.floor(hours / 24) return `vor ${days} Tag${days > 1 ? 'en' : ''}` } interface ProjectCardProps { project: ProjectInfo onClick: () => void onDelete?: () => void onRestore?: () => void } export function ProjectCard({ project, onClick, onDelete, onRestore, }: ProjectCardProps) { const timeAgo = formatTimeAgo(project.updatedAt) const isArchived = project.status === 'archived' return (