mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-06-17 06:41:04 +00:00
d21bfb1320
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
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
// Copyright 2017-2025 @pezkuwi/app-council authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { DeriveElectionsInfo } from '@pezkuwi/api-derive/types';
|
|
import type { AccountId } from '@pezkuwi/types/interfaces';
|
|
|
|
import React, { useRef } from 'react';
|
|
|
|
import { Table } from '@pezkuwi/react-components';
|
|
|
|
import { useTranslation } from '../translate.js';
|
|
import Candidate from './Candidate.js';
|
|
|
|
interface Props {
|
|
allVotes?: Record<string, AccountId[]>;
|
|
className?: string;
|
|
electionsInfo?: DeriveElectionsInfo;
|
|
hasElections: boolean;
|
|
prime?: AccountId | null;
|
|
}
|
|
|
|
function Members ({ allVotes = {}, className = '', electionsInfo, hasElections, prime }: Props): React.ReactElement<Props> {
|
|
const { t } = useTranslation();
|
|
|
|
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
|
|
[t('members'), 'start', 2]
|
|
]);
|
|
|
|
return (
|
|
<Table
|
|
className={className}
|
|
empty={electionsInfo && t('No members found')}
|
|
header={headerRef.current}
|
|
isSplit
|
|
>
|
|
{electionsInfo?.members.map(([accountId, balance]): React.ReactNode => (
|
|
<Candidate
|
|
address={accountId}
|
|
balance={balance}
|
|
hasElections={hasElections}
|
|
isPrime={prime?.eq(accountId)}
|
|
key={accountId.toString()}
|
|
voters={allVotes[accountId.toString()]}
|
|
/>
|
|
))}
|
|
</Table>
|
|
);
|
|
}
|
|
|
|
export default React.memo(Members);
|