Merge pull request 'Ui update' (#7) from ui-update into main
Deploy Next.js via Docker / deploy (push) Successful in 28s
Deploy Next.js via Docker / deploy (push) Successful in 28s
Reviewed-on: Schanbro/PsalmTafel#7
This commit was merged in pull request #7.
This commit is contained in:
commit
47375c6b9f
10 files changed
+179
-155
No files matched your search
+30
-61
@@ -3,6 +3,9 @@
|
|||||||
import { uploadCSVAction } from "./actions";
|
import { uploadCSVAction } from "./actions";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
import Card from "@/components/Card"
|
||||||
|
import { Input } from "@/components/FormElements";
|
||||||
|
|
||||||
interface Songbook {
|
interface Songbook {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -103,66 +106,52 @@ 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="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>
|
||||||
<input
|
<Input.Text
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="z.B. Gesangbuch"
|
placeholder="z.B. Gesangbuch"
|
||||||
className="w-full bg-black border border-neutral-700 rounded-lg px-3 py-2 text-white placeholder-neutral-500 focus:outline-none focus:border-blue-400 text-sm"
|
|
||||||
value={newBookName}
|
value={newBookName}
|
||||||
onChange={(e) => setNewBookName(e.target.value)}
|
onChange={(e) => setNewBookName(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Sprache (Optional)</label>
|
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Sprache (Optional)</label>
|
||||||
<input
|
<Input.Text
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="z.B. Deutsch"
|
placeholder="z.B. Deutsch"
|
||||||
className="w-full bg-black border border-neutral-700 rounded-lg px-3 py-2 text-white placeholder-neutral-500 focus:outline-none focus:border-blue-400 text-sm"
|
|
||||||
value={newBookLanguage}
|
value={newBookLanguage}
|
||||||
onChange={(e) => setNewBookLanguage(e.target.value)}
|
onChange={(e) => setNewBookLanguage(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<Input.Button
|
||||||
</div>
|
|
||||||
<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>
|
</Input.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>
|
||||||
<select
|
<Input.Select
|
||||||
className="w-full bg-black border border-neutral-700 rounded-lg px-3 py-2 text-white focus:outline-none focus:border-blue-400 text-sm h-[38px]"
|
|
||||||
value={selectedSongbookId}
|
value={selectedSongbookId}
|
||||||
onChange={(e) => setSelectedSongbookId(e.target.value)}
|
onChange={(e) => setSelectedSongbookId(e.target.value)}
|
||||||
>
|
>
|
||||||
@@ -172,53 +161,39 @@ export default function AdminPage() {
|
|||||||
{book.name}{book.language ? ` (${book.language})` : ""}
|
{book.name}{book.language ? ` (${book.language})` : ""}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</Input.Select>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-3 gap-2">
|
<div className="grid grid-cols-3 gap-2">
|
||||||
<div className="col-span-1">
|
<div className="col-span-1">
|
||||||
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Nummer</label>
|
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Nummer</label>
|
||||||
<input
|
<Input.Text
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="12a"
|
placeholder="12a"
|
||||||
className="w-full bg-black border border-neutral-700 rounded-lg px-3 py-2 text-white placeholder-neutral-500 focus:outline-none focus:border-blue-400 text-sm"
|
|
||||||
value={number}
|
value={number}
|
||||||
onChange={(e) => setNumber(e.target.value)}
|
onChange={(e) => setNumber(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-span-2">
|
<div className="col-span-2">
|
||||||
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Liedtitel</label>
|
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Liedtitel</label>
|
||||||
<input
|
<Input.Text
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Großer Gott, wir..."
|
placeholder="Großer Gott, wir..."
|
||||||
className="w-full bg-black border border-neutral-700 rounded-lg px-3 py-2 text-white placeholder-neutral-500 focus:outline-none focus:border-blue-400 text-sm"
|
|
||||||
value={title}
|
value={title}
|
||||||
onChange={(e) => setTitle(e.target.value)}
|
onChange={(e) => setTitle(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<Input.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</Input.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>
|
||||||
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Ziel-Liederbuch</label>
|
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Ziel-Liederbuch</label>
|
||||||
<select
|
<Input.Select
|
||||||
className="w-full bg-black border border-neutral-700 rounded-lg px-3 py-2 text-white focus:outline-none focus:border-blue-400 text-sm h-[38px]"
|
|
||||||
value={selectedSongbookId}
|
value={selectedSongbookId}
|
||||||
onChange={(e) => setSelectedSongbookId(e.target.value)}
|
onChange={(e) => setSelectedSongbookId(e.target.value)}
|
||||||
>
|
>
|
||||||
@@ -228,37 +203,31 @@ export default function AdminPage() {
|
|||||||
{book.name}{book.language ? ` (${book.language})` : ""}
|
{book.name}{book.language ? ` (${book.language})` : ""}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</Input.Select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Datei auswählen (.csv)</label>
|
<label className="block text-xs font-semibold text-neutral-400 uppercase tracking-wider mb-1.5">Datei auswählen (.csv)</label>
|
||||||
<input
|
<Input.File
|
||||||
type="file"
|
|
||||||
name="csvFile"
|
name="csvFile"
|
||||||
accept=".csv"
|
accept=".csv"
|
||||||
required
|
required
|
||||||
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
|
<Input.Button
|
||||||
type="submit"
|
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
|
Hochladen & Verarbeiten
|
||||||
</button>
|
</Input.Button >
|
||||||
{uploadStatus && (
|
{uploadStatus && (
|
||||||
<p className="text-xs text-center font-medium px-3 py-2 rounded-md bg-black border border-neutral-800 text-blue-400">
|
<p className="text-xs text-center font-medium px-3 py-2 rounded-md bg-black border border-neutral-800 text-blue-400">
|
||||||
{uploadStatus}
|
{uploadStatus}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</Card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+9
-5
@@ -2,6 +2,8 @@ import type { Metadata } from "next";
|
|||||||
import { Geist, Geist_Mono } from "next/font/google";
|
import { Geist, Geist_Mono } from "next/font/google";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
|
||||||
|
import Header from "@/components/Header"
|
||||||
|
|
||||||
const geistSans = Geist({
|
const geistSans = Geist({
|
||||||
variable: "--font-geist-sans",
|
variable: "--font-geist-sans",
|
||||||
subsets: ["latin"],
|
subsets: ["latin"],
|
||||||
@@ -23,11 +25,13 @@ export default function RootLayout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html
|
<html lang="de">
|
||||||
lang="en"
|
<body className="min-h-screen flex flex-col">
|
||||||
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
|
<Header />
|
||||||
>
|
|
||||||
<body className="min-h-full flex flex-col">{children}</body>
|
<main className="mt-20 mx-auto min-w-200 max-w-full">{children}</main>
|
||||||
|
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+15
-57
@@ -1,65 +1,23 @@
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
|
||||||
export default function Home() {
|
export default function DashboardPage() {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col flex-1 items-center justify-center bg-zinc-50 font-sans dark:bg-black">
|
<>
|
||||||
<main className="flex flex-1 w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
|
{/* Das Hintergrundbild brecht aus allen Containern aus und füllt das Fenster */}
|
||||||
<Image
|
<div className="fixed inset-0 -z-10 h-screen w-screen overflow-hidden">
|
||||||
className="dark:invert"
|
{/* <Image
|
||||||
src="/next.svg"
|
src="/fakurian_purple.jpg"
|
||||||
alt="Next.js logo"
|
alt="Hintergrund"
|
||||||
width={100}
|
fill
|
||||||
height={20}
|
className="object-cover"
|
||||||
priority
|
priority
|
||||||
/>
|
/> */}
|
||||||
<div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
|
|
||||||
<h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50">
|
|
||||||
Hello, PsalmTafel wurde aktualisiert! (v0.0.1.3)
|
|
||||||
</h1>
|
|
||||||
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
|
|
||||||
Looking for a starting point or more instructions? Head over to{" "}
|
|
||||||
<a
|
|
||||||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
|
||||||
className="font-medium text-zinc-950 dark:text-zinc-50"
|
|
||||||
>
|
|
||||||
Templates
|
|
||||||
</a>{" "}
|
|
||||||
or the{" "}
|
|
||||||
<a
|
|
||||||
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
|
||||||
className="font-medium text-zinc-950 dark:text-zinc-50"
|
|
||||||
>
|
|
||||||
Learning
|
|
||||||
</a>{" "}
|
|
||||||
center.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
|
|
||||||
<a
|
{/* Dein Inhalt auf dieser Seite */}
|
||||||
className="flex h-12 w-full items-center justify-center gap-2 rounded-full bg-foreground px-5 text-background transition-colors hover:bg-[#383838] dark:hover:bg-[#ccc] md:w-[158px]"
|
<div className="relative">
|
||||||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
<p>Dashboard is comming soon...</p>
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
className="dark:invert"
|
|
||||||
src="/vercel.svg"
|
|
||||||
alt="Vercel logomark"
|
|
||||||
width={16}
|
|
||||||
height={16}
|
|
||||||
/>
|
|
||||||
Deploy Now
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-[158px]"
|
|
||||||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>
|
|
||||||
Documentation
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+23
-32
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
|
import { Input } from "@/components/FormElements";
|
||||||
|
|
||||||
interface Songbook {
|
interface Songbook {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -86,71 +88,62 @@ export default function SenderPage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-black text-white font-sans p-4 sm:p-6 lg:p-8">
|
<div>
|
||||||
<div className="max-w-4xl mx-auto space-y-6">
|
|
||||||
|
|
||||||
{/* TITEL DER SEITE */}
|
|
||||||
<header className="border-b border-neutral-800 pb-4">
|
|
||||||
<h1 className="text-2xl sm:text-3xl font-bold tracking-tight text-white">Chor-Anzeige Bedienfeld</h1>
|
|
||||||
<p className="text-neutral-400 text-sm mt-1">Lieder auswählen und live auf das Display übertragen.</p>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
{/* LIEDERSUCHE */}
|
{/* LIEDERSUCHE */}
|
||||||
<div className="bg-neutral-900 border border-neutral-800 rounded-xl p-4 sm:p-6 shadow-md flex flex-col h-[500px]">
|
<div className="p-4 sm:p-6 flex flex-col h-[500px]">
|
||||||
<h2 className="text-lg font-semibold text-white mb-3 flex items-center gap-2">
|
<h2 className="text-lg font-semibold mb-3 flex items-center gap-2">
|
||||||
<span className="h-2 w-2 rounded-full bg-blue-400"></span> Liedersuche & Datenbank
|
Liedersuche & Datenbank
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<input
|
<Input.Text
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Nach Songtitel oder Nummer suchen..."
|
placeholder="Nach Songtitel oder Nummer suchen..."
|
||||||
className="w-full bg-black border border-neutral-700 rounded-lg px-4 py-2.5 text-white placeholder-neutral-500 focus:outline-none focus:border-blue-400 text-sm"
|
|
||||||
value={song_search_name}
|
value={song_search_name}
|
||||||
onChange={(e) => search(e.target.value)}
|
onChange={(e) => search(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* TABELLE */}
|
{/* TABELLE */}
|
||||||
<div className="flex-1 overflow-auto border border-neutral-800 rounded-lg bg-black">
|
<div className="flex-1 overflow-auto border border-neutral-200 dark:border-neutral-800 rounded-lg bg-white dark:bg-black">
|
||||||
<table className="w-full text-left border-collapse text-sm">
|
<table className="w-full text-left border-collapse text-sm">
|
||||||
<thead className="bg-neutral-900 sticky top-0 border-b border-neutral-800 z-10">
|
<thead className="bg-neutral-100 dark:bg-neutral-900 sticky top-0 border-b border-neutral-200 dark:border-neutral-800 z-10">
|
||||||
<tr>
|
<tr>
|
||||||
<th className="p-3 text-xs font-semibold text-neutral-400 uppercase tracking-wider">Titel</th>
|
<th className="p-3 text-xs font-semibold text-neutral-600 dark:text-neutral-400 uppercase tracking-wider">Titel</th>
|
||||||
<th className="p-3 text-xs font-semibold text-neutral-400 uppercase tracking-wider hidden sm:table-cell">Liederbuch</th>
|
<th className="p-3 text-xs font-semibold text-neutral-600 dark:text-neutral-400 uppercase tracking-wider">Liederbuch</th>
|
||||||
<th className="p-3 text-xs font-semibold text-neutral-400 uppercase tracking-wider text-center">Nummer</th>
|
<th className="p-3 text-xs font-semibold text-neutral-600 dark:text-neutral-400 uppercase tracking-wider text-center">Nummer</th>
|
||||||
<th className="p-3 text-xs font-semibold text-neutral-400 uppercase tracking-wider text-right">Aktion</th>
|
<th className="p-3 text-xs font-semibold text-neutral-600 dark:text-neutral-400 uppercase tracking-wider text-right">Aktion</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="divide-y divide-neutral-800">
|
<tbody className="divide-y divide-neutral-200 dark:divide-neutral-800">
|
||||||
{searchResults.length === 0 ? (
|
{searchResults.length === 0 ? (
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan={4} className="p-8 text-center text-neutral-500">Keine Lieder gefunden</td>
|
<td colSpan={4} className="p-8 text-center text-neutral-400 dark:text-neutral-500">Keine Lieder gefunden</td>
|
||||||
</tr>
|
</tr>
|
||||||
) : (
|
) : (
|
||||||
searchResults.map((song) => {
|
searchResults.map((song) => {
|
||||||
const songBook = songbooks.find((book) => book.id === song.songbook_id);
|
const songBook = songbooks.find((book) => book.id === song.songbook_id);
|
||||||
return (
|
return (
|
||||||
<tr key={`${song.songbook_id}-${song.song_id}`} className="hover:bg-neutral-900/40 transition">
|
<tr key={`${song.songbook_id}-${song.song_id}`} className="hover:bg-neutral-100/60 dark:hover:bg-neutral-900/40 transition">
|
||||||
<td className="p-3 font-medium text-white max-w-[180px] sm:max-w-none truncate">
|
<td className="p-3 font-medium text-neutral-900 dark:text-white max-w-[180px] sm:max-w-none truncate">
|
||||||
{song.title}
|
{song.title}
|
||||||
<span className="block text-xs text-neutral-400 sm:hidden mt-0.5">
|
<span className="block text-xs text-neutral-500 dark:text-neutral-400 sm:hidden mt-0.5">
|
||||||
{songBook ? songBook.name : "Unbekannt"}
|
{songBook ? songBook.name : "Unbekannt"}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="p-3 text-neutral-300 hidden sm:table-cell">
|
<td className="p-3 text-neutral-700 dark:text-neutral-300 hidden sm:table-cell">
|
||||||
{songBook ? songBook.name : "Unbekannt"}
|
{songBook ? songBook.name : "Unbekannt"}
|
||||||
</td>
|
</td>
|
||||||
<td className="p-3 text-center font-mono text-blue-400 font-bold">
|
<td className="p-3 text-center font-mono text-blue-600 dark:text-blue-400 font-bold">
|
||||||
{song.song_number}
|
{song.song_number}
|
||||||
</td>
|
</td>
|
||||||
<td className="p-3 text-right">
|
<td className="p-3 text-right">
|
||||||
<button
|
<Input.Button
|
||||||
onClick={() => sendID(String(song.song_id), String(song.songbook_id))}
|
onClick={() => sendID(String(song.song_id), String(song.songbook_id))}
|
||||||
className="bg-black hover:bg-blue-600 border border-neutral-700 hover:border-blue-500 text-neutral-200 hover:text-white font-medium rounded-md px-3 py-1.5 transition text-xs"
|
className="bg-white dark:bg-black hover:bg-blue-600 dark:hover:bg-blue-600 border border-neutral-300 dark:border-neutral-700 hover:border-blue-600 dark:hover:border-blue-500 hover:text-white font-medium rounded-md px-3 py-1.5 transition text-xs"
|
||||||
>
|
>
|
||||||
Anzeigen
|
Anzeigen
|
||||||
</button>
|
</Input.Button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
@@ -160,8 +153,6 @@ export default function SenderPage() {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</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>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import { ChangeEvent, ReactNode } from "react";
|
||||||
|
import { ComponentPropsWithoutRef } from "react";
|
||||||
|
|
||||||
|
interface TextfieldProps extends ComponentPropsWithoutRef<"input"> {}
|
||||||
|
|
||||||
|
function Textfield({value, onChange, placeholder}: TextfieldProps) {
|
||||||
|
return (
|
||||||
|
<input
|
||||||
|
className="w-full border border-neutral-700 rounded-lg px-4 py-2.5 placeholder-neutral-500 focus:outline-none focus:border-blue-400 text-sm"
|
||||||
|
value={value}
|
||||||
|
onChange={onChange}
|
||||||
|
placeholder={placeholder}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function Dropdown({ children, ...props }: ComponentPropsWithoutRef<"select">) {
|
||||||
|
return (
|
||||||
|
<select
|
||||||
|
className="w-full border border-neutral-700 rounded-lg px-3 py-2 focus:outline-none focus:border-blue-400 text-sm h-[38px]"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</select>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function File({ ...props }: ComponentPropsWithoutRef<"input">) {
|
||||||
|
return (
|
||||||
|
<input
|
||||||
|
type="file"
|
||||||
|
className="p-1 text-sm w-full rounded-lg border border-neutral-300 dark:border-neutral-700 bg-white dark:bg-black text-black dark:text-white cursor-pointer file:mr-4 file:py-2 file:px-4 file:rounded-sm file:border-0 file:font-semibold file:transition file:bg-neutral-100 file:text-neutral-900 dark:file:bg-neutral-800 dark:file:text-white hover:file:bg-neutral-900 hover:file:text-white dark:hover:file:bg-white dark:hover:file:text-black"
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Button({ children, ...props }: ComponentPropsWithoutRef<"button">) {
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
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"
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Input = {
|
||||||
|
Text: Textfield,
|
||||||
|
Select: Dropdown,
|
||||||
|
File: File,
|
||||||
|
Button: Button,
|
||||||
|
};
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import NavItem from "./NavItem";
|
||||||
|
|
||||||
|
export default function Header() {
|
||||||
|
return (
|
||||||
|
<header className="fixed top-0 left-0 w-full z-50 p-4 flex justify-between items-center backdrop-blur-md">
|
||||||
|
<div className="font-bold text-xl">PsalmTafel</div>
|
||||||
|
<nav className="flex gap-4 border-2 rounded-full">
|
||||||
|
<NavItem path="/">Dashboard</NavItem>
|
||||||
|
<NavItem path="/sender">Sender</NavItem>
|
||||||
|
<NavItem path="/receiver">Empfänger</NavItem>
|
||||||
|
<NavItem path="/admin">Verwaltung</NavItem>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import Link from "next/link";
|
||||||
|
import { usePathname } from "next/navigation";
|
||||||
|
import { ReactNode } from "react";
|
||||||
|
|
||||||
|
export default function NavItem({ path, children }: { path: string; children: ReactNode }) {
|
||||||
|
const pathname = usePathname();
|
||||||
|
const isActive = pathname === path;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
href={path}
|
||||||
|
className={`px-3 py-1 rounded-full border border-transparent hover:border-current transition-all ${
|
||||||
|
isActive ? "bg-black text-white dark:bg-white dark:text-black" : ""
|
||||||
|
}`}
|
||||||
|
>{children}</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 518 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 520 KiB |
Reference in new issue
Block a user