// Copyright 2019-2022 @polkadot/extension-ui authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { AccountsContext, AuthorizeRequest, MetadataRequest, SigningRequest } from '@polkadot/extension-base/background/types'; import type { SettingsStruct } from '@polkadot/ui-settings/types'; import type { AvailableThemes } from './themes'; import React from 'react'; import settings from '@polkadot/ui-settings'; // eslint-disable-next-line @typescript-eslint/no-unused-vars const noop = (): void => undefined; const AccountContext = React.createContext({ accounts: [], hierarchy: [], master: undefined }); const ActionContext = React.createContext<(to?: string) => void>(noop); const AuthorizeReqContext = React.createContext([]); const MediaContext = React.createContext(false); const MetadataReqContext = React.createContext([]); const SettingsContext = React.createContext(settings.get()); const SigningReqContext = React.createContext([]); const ThemeSwitchContext = React.createContext<(theme: AvailableThemes) => void>(noop); const ToastContext = React.createContext<({show: (message: string) => void})>({ show: noop }); export { AccountContext, ActionContext, AuthorizeReqContext, MediaContext, MetadataReqContext, SettingsContext, SigningReqContext, ThemeSwitchContext, ToastContext };