- Delete `SyncService` and its associated bidirectional synchronization logic. - Add multiple context providers (`OfflineProvider`, `AlertProvider`, `LangContext`, `UserContext`, `SessionContext`, `WorldContext`, `SettingBookContext`) for contextual state management. - Implement `SecureStorage` for OS-level secure data encryption and replace dependency on `SyncService` synchronization. - Update localization files (`en.json`, `fr.json`) with offline mode and error-related strings.
14 lines
389 B
TypeScript
Executable File
14 lines
389 B
TypeScript
Executable File
import {Context, createContext, Dispatch, SetStateAction} from "react";
|
|
import {BookProps} from "@/lib/models/Book";
|
|
|
|
export interface BookContextProps {
|
|
book: BookProps | null,
|
|
setBook?: Dispatch<SetStateAction<BookProps | null>>
|
|
}
|
|
|
|
export const BookContext: Context<BookContextProps> = createContext<BookContextProps>({
|
|
book: null,
|
|
setBook: () => {
|
|
}
|
|
})
|