mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-10-29 21:49:53 +00:00
feat: initial Pezkuwi Apps rebrand from polkadot-apps
Rebranded terminology: - Polkadot → Pezkuwi - Kusama → Dicle - Westend → Zagros - Rococo → PezkuwiChain - Substrate → Bizinikiwi - parachain → teyrchain Custom logos with Kurdistan brand colors (#e6007a → #86e62a): - bizinikiwi-hexagon.svg - sora-bizinikiwi.svg - hezscanner.svg - heztreasury.svg - pezkuwiscan.svg - pezkuwistats.svg - pezkuwiassembly.svg - pezkuwiholic.svg
This commit is contained in:
commit
d21bfb1320
5867 files changed
+329019
No files matched your search
@@ -0,0 +1,52 @@
|
||||
// Copyright 2017-2025 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DropdownOptions } from '../util/types.js';
|
||||
import type { ConstValueBase } from './types.js';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import Dropdown from '../Dropdown.js';
|
||||
import { filterDropdownItems } from '../util/index.js';
|
||||
|
||||
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<Props> | null {
|
||||
const { className = '', isError, onChange, options, value } = props;
|
||||
|
||||
if (!options.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
className={`${className} ui--DropdownLinked-Items`}
|
||||
isError={isError}
|
||||
onChange={onChange}
|
||||
onSearch={filterDropdownItems}
|
||||
options={options}
|
||||
transform={transform(props)}
|
||||
value={value.method}
|
||||
withLabel={false}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(SelectKey);
|
||||
Reference in new issue
Block a user