Files
explore/ui/shared/block/BlockPendingUpdateHint.tsx

29 lines
896 B
TypeScript

import type { BoxProps } from '@chakra-ui/react';
import React from 'react';
import config from 'configs/app';
import { Tooltip } from 'toolkit/chakra/tooltip';
import IconSvg from 'ui/shared/IconSvg';
interface Props extends BoxProps {
view?: 'block' | 'tx';
}
const BlockPendingUpdateHint = ({ view = 'block', ...props }: Props) => {
if (!config.UI.views.block.pendingUpdateAlertEnabled) {
return null;
}
const tooltipContent = view === 'block' ?
'Block is being re-synced. Details may be incomplete until the update is finished.' :
'This transaction is part of a block that is being re-synced. Details may be incomplete until the update is finished.';
return (
<Tooltip content={ tooltipContent }>
<IconSvg boxSize={ 5 } color="icon.secondary" name="status/warning" { ...props }/>
</Tooltip>
);
};
export default React.memo(BlockPendingUpdateHint);