"use client"; import { JournalEntry } from "@/types"; import { Card, CardContent } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Markdown } from "@/components/ui/markdown"; import { CopyButton } from "@/components/ui/copy-button"; import { EntryTypeBadge } from "./entry-type-badge"; import { Clock, Tag, Link2, ChevronRight } from "lucide-react"; import Link from "next/link"; interface EntryCardProps { entry: JournalEntry; } function formatTime(timestamp: string): string { const date = new Date(timestamp); return date.toLocaleDateString("en-US", { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", }); } export function EntryCard({ entry }: EntryCardProps) { return ( {/* Clicking the header/title/content opens the entry. The footer's task badge + copy button are deliberately outside this link so they aren't nested anchors and don't trigger entry navigation. */} {/* Header */}
{formatTime(entry.timestamp)}
{entry.sentiment && ( {entry.sentiment} )}
{/* Title */}

{entry.title}

{/* Content */}
{entry.content}
{/* Footer */}
{/* Tags */} {entry.tags.length > 0 && (
{entry.tags.slice(0, 3).map((tag) => ( {tag} ))} {entry.tags.length > 3 && ( +{entry.tags.length - 3} )}
)} {/* Related Task — quick-link + copy full id */} {entry.task_id && (
Task #{entry.task_id.slice(0, 8)}
)}
); }