Ui update #7

Merged
robin merged 13 commits from ui-update into main 2026-07-25 17:51:19 +00:00
3 changed files with 46 additions and 55 deletions
Showing only changes of commit f26060cf6b - Show all commits

No files matched your search

+32 -55
View File
@@ -3,6 +3,8 @@
import { uploadCSVAction } from "./actions";
import { useEffect, useState } from "react";
import Card from "@/components/Card"
interface Songbook {
id: number;
name: string;
@@ -103,25 +105,20 @@ export default function AdminPage() {
};
return (
<div className="min-h-screen bg-black text-white font-sans p-4 sm:p-6 lg:p-8">
<div className="min-h-screen font-sans p-4 sm:p-6 lg:p-8">
<div className="max-w-6xl mx-auto space-y-6">
{/* HEADER */}
<header className="border-b border-neutral-800 pb-4">
<h1 className="text-2xl sm:text-3xl font-bold tracking-tight text-white">Chor-Anzeige Admin Panel</h1>
<p className="text-neutral-400 text-sm mt-1">Datenbank verwalten, neue Bücher erstellen und Lieder einpflegen.</p>
</header>
<h2 className="text-lg font-semibold mb-3 flex items-center gap-2">
Datenbank verwalten, neue Bücher erstellen und Lieder einpflegen
</h2>
{/* DREISPALTIRES GRID */}
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
{/* KARTE 1: NEUES LIEDERBUCH */}
<section className="bg-neutral-900 border border-neutral-800 rounded-xl p-5 shadow-md flex flex-col justify-between">
<div>
<h2 className="text-lg font-semibold text-white mb-4 flex items-center gap-2">
<span className="h-2 w-2 rounded-full bg-blue-400"></span> Neues Liederbuch
</h2>
<div className="space-y-4">
<Card title="Neues Liederbuch">
<div className="space-y-4">
<div>
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Name des Buchs</label>
<input
@@ -142,23 +139,17 @@ export default function AdminPage() {
onChange={(e) => setNewBookLanguage(e.target.value)}
/>
</div>
</div>
</div>
<button
<button
onClick={addSongbook}
className="w-full mt-6 bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg px-4 py-2.5 transition text-sm shadow-sm"
>
Liederbuch erstellen
</button>
</section>
</div>
</Card>
{/* KARTE 2: LIED HINZUFÜGEN */}
<section className="bg-neutral-900 border border-neutral-800 rounded-xl p-5 shadow-md flex flex-col justify-between">
<div>
<h2 className="text-lg font-semibold text-white mb-4 flex items-center gap-2">
<span className="h-2 w-2 rounded-full bg-blue-400"></span> Lied hinzufügen
</h2>
<div className="space-y-4">
<Card title="Lied hinzufügen">
<div className="space-y-4">
<div>
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Liederbuch wählen</label>
<select
@@ -196,23 +187,12 @@ export default function AdminPage() {
/>
</div>
</div>
<button onClick={addSong} className="w-full mt-6 bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg px-4 py-2.5 transition text-sm shadow-sm">Lied speichern</button>
</div>
</div>
<button
onClick={addSong}
className="w-full mt-6 bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg px-4 py-2.5 transition text-sm shadow-sm"
>
Lied speichern
</button>
</section>
</Card>
{/* KARTE 3: CSV IMPORT */}
<section className="bg-neutral-900 border border-neutral-800 rounded-xl p-5 shadow-md flex flex-col justify-between">
<Card title="CSV-Massenimport">
<form action={handleCSVUpload} className="h-full flex flex-col justify-between">
<div>
<h2 className="text-lg font-semibold text-white mb-4 flex items-center gap-2">
<span className="h-2 w-2 rounded-full bg-blue-400"></span> CSV-Massenimport
</h2>
<input type="hidden" name="songbookId" value={selectedSongbookId} />
<div className="space-y-4">
<div>
@@ -240,25 +220,22 @@ export default function AdminPage() {
className="w-full text-sm text-neutral-400 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-xs file:font-semibold file:bg-neutral-800 file:text-neutral-200 hover:file:bg-neutral-700 file:transition cursor-pointer"
/>
</div>
<div className="mt-6 space-y-3">
<button
type="submit"
className="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg px-4 py-2.5 transition text-sm shadow-sm"
>
Hochladen & Verarbeiten
</button>
{uploadStatus && (
<p className="text-xs text-center font-medium px-3 py-2 rounded-md bg-black border border-neutral-800 text-blue-400">
{uploadStatus}
</p>
)}
</div>
</div>
</div>
<div className="mt-6 space-y-3">
<button
type="submit"
className="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg px-4 py-2.5 transition text-sm shadow-sm"
>
Hochladen & Verarbeiten
</button>
{uploadStatus && (
<p className="text-xs text-center font-medium px-3 py-2 rounded-md bg-black border border-neutral-800 text-blue-400">
{uploadStatus}
</p>
)}
</div>
</form>
</section>
</Card>
</div>
</div>
</div>
+14
View File
@@ -0,0 +1,14 @@
import { ReactNode } from "react";
export default function Card({title, children}: {title: string, children: ReactNode}) {
return (
<section className="p-5 flex flex-col justify-between">
<h2 className="text-lg font-semibold mb-4 flex items-center gap-2">
{title}
</h2>
<div>
{children}
</div>
</section>
);
}
View File
Whitespace-only changes.