refactor: add Select (Dropdown) in FormElements

This commit is contained in:
robin committed 2026-07-25 18:57:41 +02:00
1 parent 9aa5443229
commit a3cb0616c1
2 files changed
+23 -20

No files matched your search

+14 -16
View File
@@ -151,9 +151,8 @@ export default function AdminPage() {
<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)}
> >
<option value="">-- Bitte wählen --</option> <option value="">-- Bitte wählen --</option>
@@ -162,7 +161,7 @@ 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">
@@ -194,18 +193,17 @@ export default function AdminPage() {
<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)} >
> <option value="">-- Bitte wählen --</option>
<option value="">-- Bitte wählen --</option> {songbooks.map((book) => (
{songbooks.map((book) => ( <option key={book.id} value={String(book.id)}>
<option key={book.id} value={String(book.id)}> {book.name}{book.language ? ` (${book.language})` : ""}
{book.name}{book.language ? ` (${book.language})` : ""} </option>
</option> ))}
))} </Input.Select>
</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>
+9 -4
View File
@@ -14,10 +14,15 @@ function Textfield({value, onChange, placeholder}: TextfieldProps) {
) )
} }
function Dropdown() { function Dropdown({ children, ...props }: ComponentPropsWithoutRef<"select">) {
return ( return (
<p></p> <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>
);
} }
export const Input = { export const Input = {