mirror of
https://github.com/pezkuwichain/pezkuwi-sdk-ui.git
synced 2026-06-14 04:01:03 +00:00
d949863789
Comprehensive web interface for interacting with Pezkuwi blockchain. Features: - Blockchain explorer - Wallet management - Staking interface - Governance participation - Developer tools Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.6 KiB
TypeScript
55 lines
1.6 KiB
TypeScript
// Copyright 2017-2026 @pezkuwi/app-staking authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { SessionInfo, Validator } 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 useValidatorsWaiting from '../../useValidatorsWaiting.js';
|
|
import Entry from './Entry.js';
|
|
|
|
interface Props {
|
|
className?: string;
|
|
favorites: string[];
|
|
legend: React.ReactNode;
|
|
sessionInfo: SessionInfo;
|
|
toggleFavorite: (stashId: string) => void;
|
|
validatorsActive?: Validator[];
|
|
}
|
|
|
|
function Waiting ({ className = '', favorites, legend, sessionInfo, toggleFavorite, validatorsActive }: Props): React.ReactElement<Props> {
|
|
const { t } = useTranslation();
|
|
const isNextTick = useNextTick();
|
|
const validatorsWaiting = useValidatorsWaiting(favorites, sessionInfo, validatorsActive);
|
|
|
|
const header = useRef<[string?, string?, number?][]>([
|
|
// favorite, badges, details, expand
|
|
[t('waiting'), 'start', 4]
|
|
]);
|
|
|
|
return (
|
|
<Table
|
|
className={className}
|
|
empty={isNextTick && validatorsWaiting && t('No waiting validators found')}
|
|
emptySpinner={t('Retrieving waiting validators')}
|
|
header={header.current}
|
|
isSplit
|
|
legend={legend}
|
|
>
|
|
{isNextTick && validatorsWaiting?.map((v) => (
|
|
<Entry
|
|
key={v.key}
|
|
toggleFavorite={toggleFavorite}
|
|
validator={v}
|
|
/>
|
|
))}
|
|
</Table>
|
|
);
|
|
}
|
|
|
|
export default React.memo(Waiting);
|