mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* envs and feature setup * home page layout * cross-chain txs page * cross-chain transfers page * cross-chain transfers on tx page * cross-chain messages on tx page * cross-chain tx page * cross-chain tx details token transfers * stats and counters for lists * migrate to new API version * add swagger * mobile lists * placeholder views on address page * tests * fix adaptive tabs initial state when there is only one tab in the list * tweaks * bug fixes * fix tests * update screenshots * migrate to new api version * add chain label tooltip, copy button to txs in lists and same address highlight * list views on address page * fix tests * fix links to current address in the list views * update tooltips * update tables layout * review fixes * fix spelling * update screenshots * update screenshot
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
import React from 'react';
|
|
|
|
import * as tac from '@blockscout/tac-operation-lifecycle-types';
|
|
|
|
import { STATUS_LABELS } from 'lib/operations/tac';
|
|
import { Root, Item, Trigger } from 'ui/shared/lifecycle/LifecycleAccordion';
|
|
|
|
import TacOperationLifecycleAccordionItemContent from './TacOperationLifecycleAccordionItemContent';
|
|
|
|
interface Props {
|
|
data: tac.OperationDetails['status_history'];
|
|
isLoading?: boolean;
|
|
type: tac.OperationType;
|
|
}
|
|
|
|
const TacOperationLifecycleAccordion = ({ data, isLoading, type }: Props) => {
|
|
const isPending = type === tac.OperationType.PENDING && !isLoading;
|
|
|
|
return (
|
|
<Root>
|
|
{ data.map((item, index) => {
|
|
const isLast = index === data.length - 1 && !isPending;
|
|
return (
|
|
<Item key={ index } value={ item.type }>
|
|
<Trigger
|
|
status={ item.is_success ? 'success' : 'error' }
|
|
text={ STATUS_LABELS[item.type] }
|
|
isFirst={ index === 0 }
|
|
isLast={ isLast }
|
|
isLoading={ isLoading }
|
|
/>
|
|
<TacOperationLifecycleAccordionItemContent
|
|
isLast={ isLast }
|
|
data={ item }
|
|
/>
|
|
</Item>
|
|
);
|
|
}) }
|
|
{ isPending && (
|
|
<Item value="pending">
|
|
<Trigger
|
|
status="pending"
|
|
text="Pending"
|
|
isFirst={ false }
|
|
isLast={ true }
|
|
isLoading={ isLoading }
|
|
isDisabled
|
|
/>
|
|
</Item>
|
|
) }
|
|
</Root>
|
|
);
|
|
};
|
|
|
|
export default React.memo(TacOperationLifecycleAccordion);
|