// Copyright 2019 @polkadot/extension-ui authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. import { AccountsFromCtx, OnActionFromCtx, AuthRequestsFromCtx, SignRequestsFromCtx, SubtractProps } from './types'; import React from 'react'; // eslint-disable-next-line @typescript-eslint/no-unused-vars const noop = (to?: string): void => { // do nothing }; const AccountContext = React.createContext([]); const ActionContext = React.createContext(noop); const AuthorizeContext = React.createContext([]); const SigningContext = React.createContext([]); export { AccountContext, ActionContext, AuthorizeContext, SigningContext }; export function withAccounts

(Component: React.ComponentType

): React.ComponentType> { // eslint-disable-next-line react/display-name,@typescript-eslint/explicit-function-return-type return (props: SubtractProps) => { return ( {(accounts): React.ReactNode => ( // @ts-ignore Something here with the props are going wonky )} ); }; } export function withOnAction

(Component: React.ComponentType

): React.ComponentType> { // eslint-disable-next-line react/display-name,@typescript-eslint/explicit-function-return-type return (props: SubtractProps) => { return ( {(onAction): React.ReactNode => ( // @ts-ignore Something here with the props are going wonky )} ); }; } export function withAuthRequests

(Component: React.ComponentType

): React.ComponentType> { // eslint-disable-next-line react/display-name,@typescript-eslint/explicit-function-return-type return (props: SubtractProps) => { return ( {(requests): React.ReactNode => ( // @ts-ignore Something here with the props are going wonky )} ); }; } export function withSignRequests

(Component: React.ComponentType

): React.ComponentType> { // eslint-disable-next-line react/display-name,@typescript-eslint/explicit-function-return-type return (props: SubtractProps) => { return ( {(requests): React.ReactNode => ( // @ts-ignore Something here with the props are going wonky )} ); }; }