From 1a8a159a71fd018bab0e14d9df952c53ae5ea062 Mon Sep 17 00:00:00 2001
From: yyamashita <yyamashita@mosquit.one>
Date: Fri, 15 May 2026 00:08:25 +0900
Subject: Add bands/artists index pages and redirect top page

- / now redirects to /bands
- /bands shows band list with "+ Band" link
- /artists shows artist list with "+ Artist" link
- Nav simplified to Bands / Artists only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
 app/routes/band-index.tsx | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 app/routes/band-index.tsx

(limited to 'app/routes/band-index.tsx')

diff --git a/app/routes/band-index.tsx b/app/routes/band-index.tsx
new file mode 100644
index 0000000..0b47da5
--- /dev/null
+++ b/app/routes/band-index.tsx
@@ -0,0 +1,36 @@
+import { Link, useLoaderData } from "react-router";
+import { listBands } from "~/lib/db.server";
+
+export function loader() {
+  return { bands: listBands() };
+}
+
+export default function BandIndex() {
+  const { bands } = useLoaderData<typeof loader>();
+  return (
+    <main>
+      <div className="page-header">
+        <h1>Bands</h1>
+        <Link to="/bands/new">+ Band</Link>
+      </div>
+
+      {bands.length === 0 ? (
+        <p className="muted">
+          バンドがまだありません。{" "}
+          <Link to="/bands/new">追加する</Link>
+        </p>
+      ) : (
+        <ul className="band-list">
+          {bands.map((band) => (
+            <li key={band.id}>
+              <Link to={`/bands/of/${band.id}`}>{band.name}</Link>
+              {band.status === "hiatus" && (
+                <span className="muted" style={{ fontSize: ".75rem" }}>活動休止</span>
+              )}
+            </li>
+          ))}
+        </ul>
+      )}
+    </main>
+  );
+}
-- 
cgit v1.2.3

