mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* flashblocks tab * add env variables * minor fixes * fix ts * change package for decompressing socket data * design updates * [skip ci] delete unused env * automatic mode switching for table * fix validator schema
39 lines
1016 B
TypeScript
39 lines
1016 B
TypeScript
import { Box } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import type { FlashblockItem } from 'types/client/flashblocks';
|
|
|
|
import * as SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice';
|
|
|
|
import FlashblocksListItem from './FlashblocksListItem';
|
|
|
|
interface Props {
|
|
data: Array<FlashblockItem>;
|
|
newItemsNum: number | undefined;
|
|
showAlertError?: boolean;
|
|
onAlertLinkClick?: () => void;
|
|
}
|
|
|
|
const FlashblocksList = ({ data, newItemsNum, showAlertError, onAlertLinkClick }: Props) => {
|
|
return (
|
|
<Box>
|
|
{ (newItemsNum !== undefined || showAlertError) && (
|
|
<SocketNewItemsNotice.Mobile
|
|
type="flashblock"
|
|
num={ newItemsNum }
|
|
showErrorAlert={ showAlertError }
|
|
onLinkClick={ onAlertLinkClick }
|
|
/>
|
|
) }
|
|
{ data.map((item) => (
|
|
<FlashblocksListItem
|
|
key={ `${ item.block_number }-${ item.index }` }
|
|
data={ item }
|
|
/>
|
|
)) }
|
|
</Box>
|
|
);
|
|
};
|
|
|
|
export default React.memo(FlashblocksList);
|