* fix: last block timer * refactor: update BlockHeader and BlockHeaders to use AugmentedBlockHeader type and add blockTime calculation * refactor: remove isLast prop from BlockHeader and update BlockHeaders mapping fix: update label in Summary component from 'target' to 'slot' fix: improve block time calculation in BlockAuthors context * refactor: update BlockHeader to accept multiple headers and group by timestamp in BlockHeaders * refactor: update BlockHeader time formatting and adjust display value units * refactor: simplify BlockAuthorsCtxRoot by removing blockTime calculation and parent timestamp retrieval * feat: enhance calcDelay function to handle elastic scaling and distribute delays across blocks
45 lines
1.0 KiB
TypeScript
45 lines
1.0 KiB
TypeScript
// Copyright 2017-2025 @polkadot/app-explorer authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { AugmentedBlockHeader, KeyedEvent } from '@polkadot/react-hooks/ctx/types';
|
|
|
|
import React from 'react';
|
|
|
|
import { Columar } from '@polkadot/react-components';
|
|
|
|
import BlockHeaders from './BlockHeaders.js';
|
|
import Events from './Events.js';
|
|
import Query from './Query.js';
|
|
import Summary from './Summary.js';
|
|
|
|
interface Props {
|
|
eventCount: number;
|
|
events: KeyedEvent[];
|
|
headers: AugmentedBlockHeader[];
|
|
}
|
|
|
|
function Main ({ eventCount, events, headers }: Props): React.ReactElement<Props> {
|
|
return (
|
|
<>
|
|
<Query />
|
|
<Summary
|
|
eventCount={eventCount}
|
|
headers={headers}
|
|
/>
|
|
<Columar>
|
|
<Columar.Column>
|
|
<BlockHeaders headers={headers} />
|
|
</Columar.Column>
|
|
<Columar.Column>
|
|
<Events
|
|
events={events}
|
|
showToggle
|
|
/>
|
|
</Columar.Column>
|
|
</Columar>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default React.memo(Main);
|