36 lines
830 B
TypeScript
36 lines
830 B
TypeScript
'use client';
|
|||
|
|
|
||
|
|
import { createContext, useContext } from 'react';
|
||
|
|
|
||
|
|
export interface AppSettings {
|
||
|
|
siteName: string;
|
||
|
|
selectedLeague: string;
|
||
|
|
primaryColor: string;
|
||
|
|
secondaryColor: string;
|
||
|
|
showLiveMatches: boolean;
|
||
|
|
showStandings: boolean;
|
||
|
|
showTopScorers: boolean;
|
||
|
|
showRecentResults: boolean;
|
||
|
|
showUpcoming: boolean;
|
||
|
|
refreshInterval: number;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const defaultSettings: AppSettings = {
|
||
|
|
siteName: 'Primeira Liga Stats',
|
||
|
|
selectedLeague: 'primeira_liga',
|
||
|
|
primaryColor: '#E42518',
|
||
|
|
secondaryColor: '#006600',
|
||
|
|
showLiveMatches: true,
|
||
|
|
showStandings: true,
|
||
|
|
showTopScorers: true,
|
||
|
|
showRecentResults: true,
|
||
|
|
showUpcoming: true,
|
||
|
|
refreshInterval: 300,
|
||
|
|
};
|
||
|
|
|
||
|
|
export const SettingsContext = createContext<AppSettings>(defaultSettings);
|
||
|
|
|
||
|
|
export function useSettings() {
|
||
|
|
return useContext(SettingsContext);
|
||
|
|
}
|