mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
38 lines
976 B
TypeScript
38 lines
976 B
TypeScript
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 (
|
|
<div>
|
|
{ (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 }
|
|
/>
|
|
)) }
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default React.memo(FlashblocksList);
|