mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import React from 'react';
|
|
|
|
import DataListDisplay from 'ui/shared/DataListDisplay';
|
|
import type { QueryWithPagesResult } from 'ui/shared/pagination/useQueryWithPages';
|
|
import BeaconChainWithdrawalsList from 'ui/withdrawals/beaconChain/BeaconChainWithdrawalsList';
|
|
import BeaconChainWithdrawalsTable from 'ui/withdrawals/beaconChain/BeaconChainWithdrawalsTable';
|
|
|
|
type Props = {
|
|
blockWithdrawalsQuery: QueryWithPagesResult<'general:block_withdrawals'>;
|
|
};
|
|
const TABS_HEIGHT = 88;
|
|
|
|
const BlockWithdrawals = ({ blockWithdrawalsQuery }: Props) => {
|
|
const content = blockWithdrawalsQuery.data?.items ? (
|
|
<>
|
|
<div className="lg:hidden">
|
|
<BeaconChainWithdrawalsList
|
|
items={ blockWithdrawalsQuery.data.items }
|
|
isLoading={ blockWithdrawalsQuery.isPlaceholderData }
|
|
view="block"
|
|
/>
|
|
</div>
|
|
<div className="hidden lg:block">
|
|
<BeaconChainWithdrawalsTable
|
|
items={ blockWithdrawalsQuery.data.items }
|
|
isLoading={ blockWithdrawalsQuery.isPlaceholderData }
|
|
top={ blockWithdrawalsQuery.pagination.isVisible ? TABS_HEIGHT : 0 }
|
|
view="block"
|
|
/>
|
|
</div>
|
|
</>
|
|
) : null ;
|
|
|
|
return (
|
|
<DataListDisplay
|
|
isError={ blockWithdrawalsQuery.isError }
|
|
itemsNum={ blockWithdrawalsQuery.data?.items?.length }
|
|
emptyText="There are no withdrawals for this block."
|
|
>
|
|
{ content }
|
|
</DataListDisplay>
|
|
);
|
|
};
|
|
|
|
export default BlockWithdrawals;
|