Introduces an exportOrdersToCSV function in lib/api-client.ts to allow exporting orders by status as a CSV file. Updates various UI components to use the '•' (bullet) symbol instead of '·' (middle dot) and replaces some emoji/unicode characters for improved consistency and compatibility. Also normalizes the 'use client' directive to include a BOM in many files.
35 lines
718 B
TypeScript
35 lines
718 B
TypeScript
"use client"
|
|
|
|
import { useEffect } from "react"
|
|
|
|
/**
|
|
* Preloads the notification audio file to ensure it's ready when needed
|
|
*/
|
|
export function AudioPreloader() {
|
|
useEffect(() => {
|
|
// Preload the audio file
|
|
const audio = new Audio('/hohoho.mp3')
|
|
audio.preload = 'auto'
|
|
|
|
// Try to load it immediately
|
|
try {
|
|
const loadPromise = audio.load();
|
|
if (loadPromise !== undefined) {
|
|
loadPromise.catch(err => {
|
|
console.log('Audio preload failed (non-critical):', err)
|
|
});
|
|
}
|
|
} catch (err) {
|
|
console.log('Audio preload failed (non-critical):', err)
|
|
}
|
|
|
|
return () => {
|
|
// Cleanup
|
|
audio.src = ''
|
|
}
|
|
}, [])
|
|
|
|
return null
|
|
}
|
|
|