diff --git a/app/admin/page.tsx b/app/admin/page.tsx index 2312b76..e9eb936 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -3,6 +3,9 @@ import { uploadCSVAction } from "./actions"; import { useEffect, useState } from "react"; +import Card from "@/components/Card" +import { Input } from "@/components/FormElements"; + interface Songbook { id: number; name: string; @@ -103,67 +106,53 @@ export default function AdminPage() { }; return ( -
+
{/* HEADER */} -
-

Chor-Anzeige Admin Panel

-

Datenbank verwalten, neue Bücher erstellen und Lieder einpflegen.

-
+ +

+ Datenbank verwalten, neue Bücher erstellen und Lieder einpflegen +

{/* DREISPALTIRES GRID */}
- - {/* KARTE 1: NEUES LIEDERBUCH */} -
-
-

- Neues Liederbuch -

-
-
- - setNewBookName(e.target.value)} - /> -
-
- - setNewBookLanguage(e.target.value)} - /> -
-
-
- -
- {/* KARTE 2: LIED HINZUFÜGEN */} -
-
-

- Lied hinzufügen -

-
+ +
+
+ + setNewBookName(e.target.value)} + /> +
+
+ + setNewBookLanguage(e.target.value)} + /> +
+ + Liederbuch erstellen + +
+
+ + +
- +
- setNumber(e.target.value)} />
- setTitle(e.target.value)} />
+ Lied speichern
-
- -
+ - {/* KARTE 3: CSV IMPORT */} -
+
-
-

- CSV-Massenimport -

- + setSelectedSongbookId(e.target.value)} + > + + {songbooks.map((book) => ( + + ))} +
-
+
+ + Hochladen & Verarbeiten + + {uploadStatus && ( +

+ {uploadStatus} +

+ )} +
-
- -
- - {uploadStatus && ( -

- {uploadStatus} -

- )} -
-
- +
diff --git a/app/layout.tsx b/app/layout.tsx index 976eb90..eeeac3b 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,6 +2,8 @@ import type { Metadata } from "next"; import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; +import Header from "@/components/Header" + const geistSans = Geist({ variable: "--font-geist-sans", subsets: ["latin"], @@ -23,11 +25,13 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - - {children} + + +
+ +
{children}
+ + ); } diff --git a/app/page.tsx b/app/page.tsx index 30ebceb..71c7436 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,65 +1,23 @@ import Image from "next/image"; -export default function Home() { +export default function DashboardPage() { return ( -
-
- Next.js logo + {/* Das Hintergrundbild brecht aus allen Containern aus und füllt das Fenster */} +
+ {/* Hintergrund -
-

- Hello, PsalmTafel wurde aktualisiert! (v0.0.1.3) -

-

- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - - Learning - {" "} - center. -

-
- -
-
+ /> */} +
+ + {/* Dein Inhalt auf dieser Seite */} +
+

Dashboard is comming soon...

+
+ ); -} +} \ No newline at end of file diff --git a/app/sender/page.tsx b/app/sender/page.tsx index 64e4c21..a5a3486 100644 --- a/app/sender/page.tsx +++ b/app/sender/page.tsx @@ -2,6 +2,8 @@ import { useState, useEffect } from "react"; +import { Input } from "@/components/FormElements"; + interface Songbook { id: number; name: string; @@ -86,81 +88,70 @@ export default function SenderPage() { }; return ( -
-
+
+ {/* LIEDERSUCHE */} +
+

+ Liedersuche & Datenbank +

- {/* TITEL DER SEITE */} -
-

Chor-Anzeige Bedienfeld

-

Lieder auswählen und live auf das Display übertragen.

-
- - {/* LIEDERSUCHE */} -
-

- Liedersuche & Datenbank -

- -
- search(e.target.value)} - /> -
- - {/* TABELLE */} -
- - - - - - - - - - - {searchResults.length === 0 ? ( - - - - ) : ( - searchResults.map((song) => { - const songBook = songbooks.find((book) => book.id === song.songbook_id); - return ( - - - - - - - ); - }) - )} - -
TitelLiederbuchNummerAktion
Keine Lieder gefunden
- {song.title} - - {songBook ? songBook.name : "Unbekannt"} - - - {songBook ? songBook.name : "Unbekannt"} - - {song.song_number} - - -
-
+
+ search(e.target.value)} + />
+ {/* TABELLE */} +
+ + + + + + + + + + + {searchResults.length === 0 ? ( + + + + ) : ( + searchResults.map((song) => { + const songBook = songbooks.find((book) => book.id === song.songbook_id); + return ( + + + + + + + ); + }) + )} + +
TitelLiederbuchNummerAktion
Keine Lieder gefunden
+ {song.title} + + {songBook ? songBook.name : "Unbekannt"} + + + {songBook ? songBook.name : "Unbekannt"} + + {song.song_number} + + sendID(String(song.song_id), String(song.songbook_id))} + 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 + +
+
); diff --git a/components/Card.tsx b/components/Card.tsx new file mode 100644 index 0000000..0a8450d --- /dev/null +++ b/components/Card.tsx @@ -0,0 +1,14 @@ +import { ReactNode } from "react"; + +export default function Card({title, children}: {title: string, children: ReactNode}) { + return ( +
+

+ {title} +

+
+ {children} +
+
+ ); +} \ No newline at end of file diff --git a/components/FormElements.tsx b/components/FormElements.tsx new file mode 100644 index 0000000..d2f722c --- /dev/null +++ b/components/FormElements.tsx @@ -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 ( + + ) +} + +function Dropdown({ children, ...props }: ComponentPropsWithoutRef<"select">) { + return ( + + ); +} + +function File({ ...props }: ComponentPropsWithoutRef<"input">) { + return ( + + ); +} + +function Button({ children, ...props }: ComponentPropsWithoutRef<"button">) { + return ( + + ) +} + +export const Input = { + Text: Textfield, + Select: Dropdown, + File: File, + Button: Button, +}; \ No newline at end of file diff --git a/components/Header.tsx b/components/Header.tsx new file mode 100644 index 0000000..3aa6a89 --- /dev/null +++ b/components/Header.tsx @@ -0,0 +1,15 @@ +import NavItem from "./NavItem"; + +export default function Header() { + return ( +
+
PsalmTafel
+ +
+ ); +} \ No newline at end of file diff --git a/components/NavItem.tsx b/components/NavItem.tsx new file mode 100644 index 0000000..b5a1df2 --- /dev/null +++ b/components/NavItem.tsx @@ -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 ( + {children} + ); +} \ No newline at end of file diff --git a/public/bg.jpg b/public/bg.jpg new file mode 100644 index 0000000..3ea6fe4 Binary files /dev/null and b/public/bg.jpg differ diff --git a/public/fakurian_purple.jpg b/public/fakurian_purple.jpg new file mode 100644 index 0000000..3085bcf Binary files /dev/null and b/public/fakurian_purple.jpg differ