-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathNotesCard.tsx
More file actions
32 lines (30 loc) · 962 Bytes
/
NotesCard.tsx
File metadata and controls
32 lines (30 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
type Note = {
id: string
username: string
title: string
description: string
created_at: string
}
type NotesCardProps = {
note: Note
}
export default function NotesCard({ note }: NotesCardProps) {
return (
<article className="mt-3 w-full max-w-xl rounded-xl border border-zinc-800 bg-zinc-950/80 p-4 shadow-sm ring-1 ring-white/5">
<header className="mb-2 flex items-center justify-between gap-3">
<h3 className="truncate text-sm font-medium text-zinc-50">
{note.title || 'Untitled Note'}
</h3>
<span className="shrink-0 text-[11px] text-zinc-500">
{new Date(note.created_at).toLocaleDateString()}
</span>
</header>
<div className="mb-2 text-[11px] text-zinc-400">
<span className="font-medium text-zinc-300">@{note.username}</span>
</div>
<p className="text-xs leading-relaxed text-zinc-200">
{note.description}
</p>
</article>
)
}