Files
immich-power-tools/src/contexts/ConfigContext.tsx
T
2024-12-28 18:25:06 +05:30

22 lines
468 B
TypeScript

import { createContext, useContext } from "react";
export interface ConfigContextType {
immichURL: string;
exImmichUrl: string;
version?: string;
geminiEnabled: boolean;
}
const ConfigContext = createContext<ConfigContextType>({
immichURL: "",
exImmichUrl: "",
version: "",
geminiEnabled: false,
});
export default ConfigContext;
export const useConfig = () => {
const context = useContext(ConfigContext) as ConfigContextType;
return context;
}