import { Link } from 'react-router-dom'; import { Block } from '@polkadot/types/interfaces'; import clsx from 'clsx'; import CodeSVG from '@/shared/assets/images/actions/code.svg?react'; import SummaryPlaceholderSVG from '@/shared/assets/images/placeholders/blockSummaryPlaceholder.svg?react'; import NumberPlaceholderSVG from '@/shared/assets/images/placeholders/blockNumberPlaceholder.svg?react'; import { Placeholder } from '@/entities/placeholder'; import commonStyles from '@/pages/explorer/explorer.module.scss'; import styles from './summary.module.scss'; type Props = { block: Block | undefined; isError: boolean; }; const Summary = ({ block, isError }: Props) => { const { header, hash } = block || {}; const { number, parentHash, extrinsicsRoot, stateRoot } = header || {}; const headerClassName = clsx(commonStyles.header, styles.layout); const rowClassName = clsx(commonStyles.row, styles.layout); const parentPath = `/explorer/${parentHash}`; return (
{number ? number.toString() : } isEmpty={isError} />} Hash Parent Extrinsics State
{block ? (
{hash?.toString()} {parentHash?.toString()} {extrinsicsRoot?.toString()} {stateRoot?.toString()}
) : ( } isEmpty={isError} /> )}
); }; export { Summary };