'use client'; import Link from 'next/link'; import { TagBadge } from './TagBadge'; const TYPE_COLORS: Record = { NOTE: 'bg-amber-500/20 text-amber-400', CLIP: 'bg-purple-500/20 text-purple-400', BOOKMARK: 'bg-blue-500/20 text-blue-400', CODE: 'bg-green-500/20 text-green-400', IMAGE: 'bg-pink-500/20 text-pink-400', FILE: 'bg-slate-500/20 text-slate-400', AUDIO: 'bg-red-500/20 text-red-400', }; interface NoteCardProps { id: string; title: string; type: string; contentPlain?: string | null; isPinned: boolean; updatedAt: string; tags: { id: string; name: string; color: string | null }[]; url?: string | null; archiveUrl?: string | null; } export function NoteCard({ id, title, type, contentPlain, isPinned, updatedAt, tags, url, archiveUrl }: NoteCardProps) { const snippet = (contentPlain || '').slice(0, 120); return (
{type} {isPinned && ( )} {archiveUrl && ( unlocked )} {new Date(updatedAt).toLocaleDateString()}

{title}

{url && (

{url}

)} {snippet && (

{snippet}

)} {tags.length > 0 && (
{tags.slice(0, 4).map((tag) => ( ))} {tags.length > 4 && ( +{tags.length - 4} )}
)} ); }