mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-07-25 10:25:41 +00:00
1295c36241
- Fixed TypeScript type assertion issues - Updated imports from api-augment/substrate to api-augment/bizinikiwi - Fixed imgConvert.mjs header and imports - Added @ts-expect-error for runtime-converted types - Fixed all @polkadot copyright headers to @pezkuwi
51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { Params } from './types.js';
|
|
|
|
import React from 'react';
|
|
|
|
import { CardSummary, SummaryBox } from '@pezkuwi/react-components';
|
|
import { formatNumber, isNumber } from '@pezkuwi/util';
|
|
|
|
import { useTranslation } from '../translate.js';
|
|
|
|
interface Props {
|
|
className?: string;
|
|
params: Params;
|
|
poolCount?: number;
|
|
}
|
|
|
|
function Summary ({ className, params: { maxMembers, maxMembersPerPool, maxPools }, poolCount }: Props): React.ReactElement<Props> | null {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<SummaryBox className={className}>
|
|
<CardSummary label={t('pools')}>
|
|
{isNumber(poolCount) && (
|
|
<>
|
|
{formatNumber(poolCount)}
|
|
{maxPools > 0 && (
|
|
<> / {formatNumber(maxPools)}</>
|
|
)}
|
|
</>
|
|
)}
|
|
</CardSummary>
|
|
<section>
|
|
{maxMembers > 0 && (
|
|
<CardSummary label={t('max. members')}>
|
|
{formatNumber(maxMembers)}
|
|
</CardSummary>
|
|
)}
|
|
{maxMembersPerPool > 0 && (
|
|
<CardSummary label={t('max. members / pool')}>
|
|
{formatNumber(maxMembersPerPool)}
|
|
</CardSummary>
|
|
)}
|
|
</section>
|
|
</SummaryBox>
|
|
);
|
|
}
|
|
|
|
export default React.memo(Summary);
|