mirror of
https://github.com/Novattz/creamlinux-installer.git
synced 2026-05-02 04:52:03 -04:00
Formatting
This commit is contained in:
@@ -4,54 +4,58 @@ import { ActionType } from '@/components/buttons/ActionButton'
|
||||
|
||||
// Types for context sub-components
|
||||
export interface InstallationInstructions {
|
||||
type: string;
|
||||
command: string;
|
||||
game_title: string;
|
||||
dlc_count?: number;
|
||||
type: string
|
||||
command: string
|
||||
game_title: string
|
||||
dlc_count?: number
|
||||
}
|
||||
|
||||
export interface DlcDialogState {
|
||||
visible: boolean;
|
||||
gameId: string;
|
||||
gameTitle: string;
|
||||
dlcs: DlcInfo[];
|
||||
isLoading: boolean;
|
||||
isEditMode: boolean;
|
||||
progress: number;
|
||||
timeLeft?: string;
|
||||
visible: boolean
|
||||
gameId: string
|
||||
gameTitle: string
|
||||
dlcs: DlcInfo[]
|
||||
isLoading: boolean
|
||||
isEditMode: boolean
|
||||
progress: number
|
||||
timeLeft?: string
|
||||
}
|
||||
|
||||
export interface ProgressDialogState {
|
||||
visible: boolean;
|
||||
title: string;
|
||||
message: string;
|
||||
progress: number;
|
||||
showInstructions: boolean;
|
||||
instructions?: InstallationInstructions;
|
||||
visible: boolean
|
||||
title: string
|
||||
message: string
|
||||
progress: number
|
||||
showInstructions: boolean
|
||||
instructions?: InstallationInstructions
|
||||
}
|
||||
|
||||
// Define the context type
|
||||
export interface AppContextType {
|
||||
// Game state
|
||||
games: Game[];
|
||||
isLoading: boolean;
|
||||
error: string | null;
|
||||
loadGames: () => Promise<boolean>;
|
||||
handleProgressDialogClose: () => void;
|
||||
|
||||
games: Game[]
|
||||
isLoading: boolean
|
||||
error: string | null
|
||||
loadGames: () => Promise<boolean>
|
||||
handleProgressDialogClose: () => void
|
||||
|
||||
// DLC management
|
||||
dlcDialog: DlcDialogState;
|
||||
handleGameEdit: (gameId: string) => void;
|
||||
handleDlcDialogClose: () => void;
|
||||
|
||||
dlcDialog: DlcDialogState
|
||||
handleGameEdit: (gameId: string) => void
|
||||
handleDlcDialogClose: () => void
|
||||
|
||||
// Game actions
|
||||
progressDialog: ProgressDialogState;
|
||||
handleGameAction: (gameId: string, action: ActionType) => Promise<void>;
|
||||
handleDlcConfirm: (selectedDlcs: DlcInfo[]) => void;
|
||||
|
||||
progressDialog: ProgressDialogState
|
||||
handleGameAction: (gameId: string, action: ActionType) => Promise<void>
|
||||
handleDlcConfirm: (selectedDlcs: DlcInfo[]) => void
|
||||
|
||||
// Toast notifications
|
||||
showToast: (message: string, type: 'success' | 'error' | 'warning' | 'info', options?: Record<string, unknown>) => void;
|
||||
showToast: (
|
||||
message: string,
|
||||
type: 'success' | 'error' | 'warning' | 'info',
|
||||
options?: Record<string, unknown>
|
||||
) => void
|
||||
}
|
||||
|
||||
// Create the context with a default value
|
||||
export const AppContext = createContext<AppContextType | undefined>(undefined);
|
||||
export const AppContext = createContext<AppContextType | undefined>(undefined)
|
||||
|
||||
Reference in New Issue
Block a user