// Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { DropdownOptions } from '../util/types'; import type { ConstValueBase } from './types'; import React from 'react'; import Dropdown from '../Dropdown'; interface Props { className?: string; isError?: boolean; onChange: (value: ConstValueBase) => void; options: DropdownOptions; value: ConstValueBase; } function transform ({ value }: Props): (method: string) => ConstValueBase { return (method: string): ConstValueBase => { const section = value.section; return { method, section }; }; } function SelectKey (props: Props): React.ReactElement | null { const { className = '', isError, onChange, options, value } = props; if (!options.length) { return null; } return ( ); } export default React.memo(SelectKey);