style: allow props to the songs screen

This commit is contained in:
robin committed 2026-07-27 15:10:59 +02:00
1 parent 0712740eb2
commit ca02fe9e30
2 files changed
+9 -4

No files matched your search

+1
View File
@@ -232,6 +232,7 @@ export default function AdminPage() {
</div> </div>
<Screens.Songs <Screens.Songs
onSelectSong={(song) => console.log(song)} onSelectSong={(song) => console.log(song)}
className="w-[600px]"
/> />
</div> </div>
</div> </div>
+8 -4
View File
@@ -1,9 +1,9 @@
import { useState, useEffect } from "react"; import { useState, useEffect, ComponentPropsWithoutRef } from "react";
import Card from "./Card" import Card from "./Card"
import { Input } from "./FormElements" import { Input } from "./FormElements"
interface SongsProps { interface SongsProps extends Omit<ComponentPropsWithoutRef<typeof Card>, "title" | "children"> {
onSelectSong?: (song: Song) => void; onSelectSong?: (song: Song) => void;
} }
@@ -20,7 +20,7 @@ interface Songbook {
language: string; language: string;
} }
function Songs({onSelectSong}: SongsProps) { function Songs({ onSelectSong, className = "", ...props }: SongsProps) {
const [song_search_name, setSongSearchName] = useState(""); const [song_search_name, setSongSearchName] = useState("");
const [searchResults, setSearchResults] = useState<Song[]>([]); const [searchResults, setSearchResults] = useState<Song[]>([]);
const [allSongs, setAllSongs] = useState<Song[]>([]); const [allSongs, setAllSongs] = useState<Song[]>([]);
@@ -72,7 +72,11 @@ function Songs({onSelectSong}: SongsProps) {
}, []); }, []);
return ( return (
<Card title="Alle Lieder" className="h-[500px]"> <Card
{...props}
title="Alle Lieder"
className={`h-[500px] ${className}`}
>
<div className="mb-4"> <div className="mb-4">
<Input.Text <Input.Text
type="text" type="text"