feat: add individual actionName

This commit is contained in:
robin committed 2026-07-27 16:06:43 +02:00
1 parent ca02fe9e30
commit 1892314610
3 files changed
+7 -4

No files matched your search

+2 -1
View File
@@ -231,8 +231,9 @@ export default function AdminPage() {
</Card>
</div>
<Screens.Songs
actionName="Auswählen"
onSelectSong={(song) => console.log(song)}
className="w-[600px]"
className="w-min"
/>
</div>
</div>
+2 -1
View File
@@ -89,7 +89,8 @@ export default function SenderPage() {
};
return (
<Screens.Songs
<Screens.Songs
actionName="Anzeigen"
onSelectSong={(song) => sendID(String(song.song_id), String(song.songbook_id))}
/>
);
+3 -2
View File
@@ -5,6 +5,7 @@ import { Input } from "./FormElements"
interface SongsProps extends Omit<ComponentPropsWithoutRef<typeof Card>, "title" | "children"> {
onSelectSong?: (song: Song) => void;
actionName?: string;
}
interface Song {
@@ -20,7 +21,7 @@ interface Songbook {
language: string;
}
function Songs({ onSelectSong, className = "", ...props }: SongsProps) {
function Songs({ actionName, onSelectSong, className = "", ...props }: SongsProps) {
const [song_search_name, setSongSearchName] = useState("");
const [searchResults, setSearchResults] = useState<Song[]>([]);
const [allSongs, setAllSongs] = useState<Song[]>([]);
@@ -123,7 +124,7 @@ function Songs({ onSelectSong, className = "", ...props }: SongsProps) {
onClick={() => onSelectSong?.(song)}
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
{actionName}
</Input.Button>
</td>
</tr>