diff --git a/frontend/src/app/nominations/page.tsx b/frontend/src/app/nominations/page.tsx index 1d2c23f..b8e5772 100644 --- a/frontend/src/app/nominations/page.tsx +++ b/frontend/src/app/nominations/page.tsx @@ -1,14 +1,31 @@ "use client"; import { useState } from "react"; import { Nunito } from "next/font/google"; +import { api } from "muzak/data/fetcher"; const nunito = Nunito({ weight: "900", subsets: ["latin"], }); +async function nominate(spotifyLink: string) { + console.log(spotifyLink); + try { + const response = await api.tracks.nominate({ + spotify_link: spotifyLink, + }); + console.log("Nomination successful:", response); + return { success: true, data: response.data }; + } catch (error) { + console.error("Nomination failed:", error); + return { success: false, error }; + } +} + export default function Nominations() { const [songURL, setSongURL] = useState(""); + const [isLoading, setIsLoading] = useState(false); + const [message, setMessage] = useState(""); return (
@@ -33,16 +50,36 @@ export default function Nominations() { + {message && ( +
+ {message} +
+ )}