diff options
| author | yyamashita <yyamashita@mosquit.one> | 2026-05-11 00:06:52 +0900 |
|---|---|---|
| committer | yyamashita <yyamashita@mosquit.one> | 2026-05-11 00:06:52 +0900 |
| commit | e9e576abd9d6c6030aa4bb290e869890831488ad (patch) | |
| tree | ec521f62ddffda13c30f5c964e01b9daa1b52851 /app/routes/list-index.tsx | |
| parent | 609dc6a3769d85e1cc4a8f06af58165be86b598c (diff) | |
Add lists feature (band recommendation lists with history)
New lists, list_entries, list_revisions tables; full CRUD routes under /lists; nav link in root.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'app/routes/list-index.tsx')
| -rw-r--r-- | app/routes/list-index.tsx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/routes/list-index.tsx b/app/routes/list-index.tsx new file mode 100644 index 0000000..7995068 --- /dev/null +++ b/app/routes/list-index.tsx @@ -0,0 +1,36 @@ +import { Link, useLoaderData } from "react-router"; +import { listBandLists } from "~/lib/db.server"; + +export function loader() { + return { lists: listBandLists() }; +} + +export default function ListIndex() { + const { lists } = useLoaderData<typeof loader>(); + return ( + <main> + <div className="page-header"> + <h1>Lists</h1> + <Link to="/lists/new">+ List</Link> + </div> + + {lists.length === 0 ? ( + <p className="muted"> + リストがまだありません。{" "} + <Link to="/lists/new">作成する</Link> + </p> + ) : ( + <ul className="band-list"> + {lists.map((list) => ( + <li key={list.id}> + <Link to={`/lists/of/${list.id}`}>{list.title}</Link> + {list.description && ( + <span className="muted" style={{ fontSize: ".75rem" }}>{list.description}</span> + )} + </li> + ))} + </ul> + )} + </main> + ); +} |
