-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
46 lines (44 loc) · 1.38 KB
/
index.tsx
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { Link } from "@remix-run/react";
import Note from "~/models/Note";
import styles from "./styles.css";
export default function NoteList({ notes }: { notes: Note[] }) {
return (
<>
<p id="warning">
⚠️ The data from this page is dynamically entered by users. The author of this project assumes no
responsibility for this content. ⚠️
</p>
<ul id="note-list">
{notes.map((note, index) => (
<li key={note.id} className="note">
<Link to={note.id}>
<article>
<header>
<ul className="note-meta">
<li>#{index + 1}</li>
<li>
<time dateTime={note.date}>
{new Date(note.date).toLocaleDateString("en-US", {
day: "numeric",
month: "short",
year: "numeric",
hour: "2-digit",
minute: "2-digit",
})}
</time>
</li>
</ul>
<h2>{note.title}</h2>
</header>
<p>{note.content}</p>
</article>
</Link>
</li>
))}
</ul>
</>
);
}
export function links() {
return [{ rel: "stylesheet", href: styles }];
}