feat: add Card component
feat: create Textfield component style: more light and dark mode support
This commit is contained in:
1 parent
2ffbae76a6
commit
f26060cf6b
3 files changed
+30
-39
No files matched your search
+16
-39
@@ -3,6 +3,8 @@
|
|||||||
import { uploadCSVAction } from "./actions";
|
import { uploadCSVAction } from "./actions";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
import Card from "@/components/Card"
|
||||||
|
|
||||||
interface Songbook {
|
interface Songbook {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -103,24 +105,19 @@ export default function AdminPage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
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">
|
<div className="max-w-6xl mx-auto space-y-6">
|
||||||
|
|
||||||
{/* HEADER */}
|
{/* 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>
|
<h2 className="text-lg font-semibold mb-3 flex items-center gap-2">
|
||||||
<p className="text-neutral-400 text-sm mt-1">Datenbank verwalten, neue Bücher erstellen und Lieder einpflegen.</p>
|
Datenbank verwalten, neue Bücher erstellen und Lieder einpflegen
|
||||||
</header>
|
</h2>
|
||||||
|
|
||||||
{/* DREISPALTIRES GRID */}
|
{/* DREISPALTIRES GRID */}
|
||||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
||||||
|
|
||||||
{/* KARTE 1: NEUES LIEDERBUCH */}
|
<Card title="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">
|
<div className="space-y-4">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Name des Buchs</label>
|
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Name des Buchs</label>
|
||||||
@@ -142,22 +139,16 @@ export default function AdminPage() {
|
|||||||
onChange={(e) => setNewBookLanguage(e.target.value)}
|
onChange={(e) => setNewBookLanguage(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button
|
<button
|
||||||
onClick={addSongbook}
|
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"
|
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
|
Liederbuch erstellen
|
||||||
</button>
|
</button>
|
||||||
</section>
|
</div>
|
||||||
|
</Card>
|
||||||
|
|
||||||
{/* KARTE 2: LIED HINZUFÜGEN */}
|
<Card title="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">
|
<div className="space-y-4">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Liederbuch wählen</label>
|
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Liederbuch wählen</label>
|
||||||
@@ -196,23 +187,12 @@ export default function AdminPage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
</div>
|
</Card>
|
||||||
<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>
|
|
||||||
|
|
||||||
{/* KARTE 3: CSV IMPORT */}
|
<Card title="CSV-Massenimport">
|
||||||
<section className="bg-neutral-900 border border-neutral-800 rounded-xl p-5 shadow-md flex flex-col justify-between">
|
|
||||||
<form action={handleCSVUpload} className="h-full flex flex-col justify-between">
|
<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} />
|
<input type="hidden" name="songbookId" value={selectedSongbookId} />
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div>
|
<div>
|
||||||
@@ -240,9 +220,6 @@ 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"
|
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>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mt-6 space-y-3">
|
<div className="mt-6 space-y-3">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
@@ -256,9 +233,9 @@ export default function AdminPage() {
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</Card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
);
|
||||||
|
}
|
||||||
Whitespace-only changes.
Reference in new issue
Block a user