From 1b917180ad64596dea479b90d82c20b7b63c2765 Mon Sep 17 00:00:00 2001 From: Phill Pover Date: Sun, 6 Apr 2025 22:13:36 +0100 Subject: [PATCH] Changing button labels --- frontend/src/app/album/page.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/album/page.tsx b/frontend/src/app/album/page.tsx index dfbd87d..9cd31e3 100644 --- a/frontend/src/app/album/page.tsx +++ b/frontend/src/app/album/page.tsx @@ -19,6 +19,7 @@ export default function Page() { const [formAlbumArtist, setFormAlbumArtist] = useState(""); const [formAlbumGenre, setFormAlbumGenre] = useState(""); const [formModalTitle, setFormModalTitle] = useState("Add Album"); + const [formModalButtonLabel, setFormModalButtonLabel] = useState("Add"); useEffect(() => { async function fetchAlbums() { @@ -52,6 +53,7 @@ export default function Page() { const handleCreate = async () => { setFormModalTitle("Add Album"); + setFormModalButtonLabel("Add"); setFormAlbumId(""); setFormAlbumTitle(""); setFormAlbumArtist(""); @@ -65,6 +67,7 @@ export default function Page() { try { const data = await getAlbum(parseInt(id)); setFormModalTitle("Edit Album"); + setFormModalButtonLabel("Save"); setFormAlbumId(data.id) setFormAlbumTitle(data.title); setFormAlbumArtist(data.artist); @@ -152,7 +155,7 @@ export default function Page() { - +