Refactor AudioPlayer and LyricSearch components/ AudioPlayer: add DJ controls (porting from old site), and optimize theme handling.

This commit is contained in:
2025-09-24 16:30:13 -04:00
parent f177315231
commit 0e46db70eb
4 changed files with 45530 additions and 113 deletions

View File

@@ -5,6 +5,7 @@ import React, {
useEffect,
useRef,
useState,
useCallback,
} from "react";
import { toast } from 'react-toastify';
import Alert from '@mui/joy/Alert';
@@ -65,7 +66,7 @@ export function LyricSearchInputField({ id, placeholder, setShowLyrics }) {
// Typeahead: fetch suggestions
const fetchSuggestions = async (event) => {
const fetchSuggestions = useCallback(async (event) => {
const query = event.query;
const res = await fetch(`${API_URL}/typeahead/lyrics`, {
method: "POST",
@@ -74,7 +75,7 @@ export function LyricSearchInputField({ id, placeholder, setShowLyrics }) {
});
const json = await res.json();
setSuggestions(json);
};
}, []);
// Toggle exclusion state for checkboxes
const toggleExclusion = (source) => {