mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-06-12 03:01:08 +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
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { SessionInfo, Validator } from '../../types.js';
|
|
import type { UsePoints } from '../types.js';
|
|
|
|
import React, { useRef } from 'react';
|
|
|
|
import { Table } from '@pezkuwi/react-components';
|
|
import { useNextTick } from '@pezkuwi/react-hooks';
|
|
|
|
import { useTranslation } from '../../translate.js';
|
|
import Entry from './Entry.js';
|
|
|
|
interface Props {
|
|
className?: string;
|
|
legend: React.ReactNode;
|
|
points?: UsePoints;
|
|
sessionInfo: SessionInfo;
|
|
toggleFavorite: (stashId: string) => void;
|
|
validatorsActive?: Validator[];
|
|
}
|
|
|
|
function Active ({ className = '', legend, points, sessionInfo, toggleFavorite, validatorsActive }: Props): React.ReactElement<Props> {
|
|
const { t } = useTranslation();
|
|
const isNextTick = useNextTick();
|
|
|
|
const header = useRef<[string?, string?, number?][]>([
|
|
// favorite, badges, details, expand
|
|
[t('validators'), 'start', 4]
|
|
]);
|
|
|
|
return (
|
|
<Table
|
|
className={className}
|
|
empty={isNextTick && validatorsActive && t('No session validators found')}
|
|
emptySpinner={t('Retrieving session validators')}
|
|
header={header.current}
|
|
isSplit
|
|
legend={legend}
|
|
>
|
|
{isNextTick && validatorsActive?.map((v) => (
|
|
<Entry
|
|
key={v.key}
|
|
points={points?.[v.stashId]}
|
|
sessionInfo={sessionInfo}
|
|
toggleFavorite={toggleFavorite}
|
|
validator={v}
|
|
/>
|
|
))}
|
|
</Table>
|
|
);
|
|
}
|
|
|
|
export default React.memo(Active);
|