feat: add environment configuration files and update API base URL handling for production

This commit is contained in:
JSC
2025-08-09 14:43:09 +02:00
parent b43d29e862
commit d53c08d7a0
10 changed files with 55 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react'
import { useContext, useEffect, useState } from 'react'
import { ThemeProviderContext, type Theme } from '@/contexts/ThemeContext'
type ThemeProviderProps = {
@@ -49,3 +49,12 @@ export function ThemeProvider({
</ThemeProviderContext.Provider>
)
}
export const useTheme = () => {
const context = useContext(ThemeProviderContext)
if (context === undefined)
throw new Error('useTheme must be used within a ThemeProvider')
return context
}

View File

@@ -26,7 +26,7 @@ import {
ArrowRight,
ArrowRightToLine
} from 'lucide-react'
import { playerService, type PlayerState, type PlayerMode } from '@/lib/api/services/player'
import { playerService, type PlayerState, type PlayerMode, type MessageResponse } from '@/lib/api/services/player'
import { filesService } from '@/lib/api/services/files'
import { playerEvents, PLAYER_EVENTS } from '@/lib/events'
import { toast } from 'sonner'
@@ -79,7 +79,7 @@ export function Player({ className }: PlayerProps) {
}
}, [])
const executeAction = useCallback(async (action: () => Promise<void>, actionName: string) => {
const executeAction = useCallback(async (action: () => Promise<void | MessageResponse>, actionName: string) => {
setIsLoading(true)
try {
await action()