// Copyright 2017-2019 @polkadot/react-components 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 { ApiProps } from '@polkadot/react-api/types'; import { DropdownOptions } from '../util/types'; import { BareProps } from '../types'; import { ConstValueBase } from './types'; import React from 'react'; import { withApi } from '@polkadot/react-api'; import Dropdown from '../Dropdown'; import { classes } from '../util'; type Props = ApiProps & BareProps & { isError?: boolean; onChange: (value: ConstValueBase) => void; options: DropdownOptions; value: ConstValueBase; }; class SelectKey extends React.PureComponent { public render (): React.ReactNode { const { className, isError, onChange, options, style, value } = this.props; if (!options.length) { return null; } return ( ); } private transform = (method: string): ConstValueBase => { const { value } = this.props; const section = value.section; return { method, section }; } } export default withApi(SelectKey);