mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-07-12 15:45:47 +00:00
971df8edba
- Remove all 3rd party parachain configurations from endpoints: - productionRelayPolkadot.ts: Keep only system parachains - productionRelayDicle.ts: Keep only system parachains - testingRelayZagros.ts: Keep only system parachains - testingRelayTeyrChain.ts: Keep only system parachains - Update domain references: - polkadot.js.org → pezkuwichain.app - wiki.polkadot.network → wiki.pezkuwichain.io - dotapps.io → pezkuwichain.app - statement.polkadot.network → docs.pezkuwichain.io/statement - support.polkadot.network → docs.pezkuwichain.io - Update repository references: - github.com/pezkuwi-js/apps → github.com/pezkuwichain/pwap - Rename system parachains to Pezkuwi ecosystem: - PolkadotAssetHub → PezkuwiAssetHub - polkadotBridgeHub → pezkuwiBridgeHub - polkadotCollectives → pezkuwiCollectives - polkadotCoretime → pezkuwiCoretime - polkadotPeople → pezkuwiPeople - Update network name in claims utility: - Polkadot → Pezkuwi
85 lines
2.4 KiB
TypeScript
85 lines
2.4 KiB
TypeScript
// Copyright 2017-2026 @pezkuwi/app-explorer authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { AugmentedBlockHeader } from '@pezkuwi/react-hooks/ctx/types';
|
|
|
|
import React from 'react';
|
|
|
|
import { CardSummary, SummaryBox } from '@pezkuwi/react-components';
|
|
import { useApi } from '@pezkuwi/react-hooks';
|
|
import { BestFinalized, BestNumber, BlockToTime, TimeNow, TotalInactive, TotalIssuance } from '@pezkuwi/react-query';
|
|
import { BN_ONE, formatNumber } from '@pezkuwi/util';
|
|
|
|
import SummarySession from './SummarySession.js';
|
|
import { useTranslation } from './translate.js';
|
|
|
|
interface Props {
|
|
eventCount: number;
|
|
headers: AugmentedBlockHeader[];
|
|
}
|
|
|
|
function Summary ({ eventCount, headers }: Props): React.ReactElement {
|
|
const { t } = useTranslation();
|
|
const { api } = useApi();
|
|
|
|
return (
|
|
<SummaryBox>
|
|
<section>
|
|
{api.query.timestamp && (
|
|
<>
|
|
<CardSummary label={t('last block')}>
|
|
{/* Restart timer on key change */}
|
|
<TimeNow key={headers.at(0)?.hash.toHex()} />
|
|
</CardSummary>
|
|
<CardSummary
|
|
className='media--800'
|
|
label={t('slot')}
|
|
>
|
|
<BlockToTime value={BN_ONE} />
|
|
</CardSummary>
|
|
</>
|
|
)}
|
|
{api.query.balances && (
|
|
<>
|
|
<CardSummary
|
|
className='media--800'
|
|
label={t('total issuance')}
|
|
>
|
|
<TotalIssuance />
|
|
</CardSummary>
|
|
{!!api.query.balances.inactiveIssuance && (
|
|
<CardSummary
|
|
className='media--1300'
|
|
label={t('inactive issuance')}
|
|
>
|
|
<TotalInactive />
|
|
</CardSummary>
|
|
)}
|
|
</>
|
|
)}
|
|
</section>
|
|
<section className='media--1100'>
|
|
<SummarySession withEra={false} />
|
|
</section>
|
|
<section>
|
|
<CardSummary
|
|
className='media--1400'
|
|
label={t('last events')}
|
|
>
|
|
{formatNumber(eventCount)}
|
|
</CardSummary>
|
|
{api.query.grandpa && (
|
|
<CardSummary label={t('finalized')}>
|
|
<BestFinalized />
|
|
</CardSummary>
|
|
)}
|
|
<CardSummary label={t('best')}>
|
|
<BestNumber />
|
|
</CardSummary>
|
|
</section>
|
|
</SummaryBox>
|
|
);
|
|
}
|
|
|
|
export default React.memo(Summary);
|