Files
tom goriunovandGitHub f982eb07a0 Time format toggle for table views (#2729)
* cookie for storing time format value

* rename TimeAgo component

* add toggle to tables (pt. 1)

* move TimeWithTooltip component

* add toggle to tables (pt. 2)

* change implementation of toggle component

* remove unnecessary timestamp label

* update screenshots

* more screenshot updates

* [skip ci] update clock icon

* update screenshots
2025-06-03 14:01:12 +02:00

41 lines
1.3 KiB
TypeScript

import React from 'react';
import type { ShibariumWithdrawalsItem } from 'types/api/shibarium';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import WithdrawalsTableItem from './WithdrawalsTableItem';
type Props = {
items: Array<ShibariumWithdrawalsItem>;
top: number;
isLoading?: boolean;
};
const WithdrawalsTable = ({ items, top, isLoading }: Props) => {
return (
<TableRoot tableLayout="auto" minW="950px">
<TableHeaderSticky top={ top }>
<TableRow>
<TableColumnHeader>L2 block No</TableColumnHeader>
<TableColumnHeader>L2 txn hash</TableColumnHeader>
<TableColumnHeader>L1 txn hash</TableColumnHeader>
<TableColumnHeader>User</TableColumnHeader>
<TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
</TableRow>
</TableHeaderSticky>
<TableBody>
{ items.map((item, index) => (
<WithdrawalsTableItem key={ `${ item.l2_transaction_hash }-${ index }` } item={ item } isLoading={ isLoading }/>
)) }
</TableBody>
</TableRoot>
);
};
export default WithdrawalsTable;