mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* zetachain start * zeta chain cctx table * pagination * cctx page init * meta for new route * remove backlink * schema * continue * fix * navigation * filters to test * some fixes * add chain filter * add error message and revert options * address chain logo fix * cctx search * socket * fix conflict * fixes1 * fixes2 * fixes3 * fixes4 * fixes5 * tests * fixes6 * test fixes * revert options fix * stats and revert semi-fix * fix readme * cleanup * check for cctx in lifecycle * update config * fixes 8 * fixes 9 * update config * fixes10
53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
|
|
import { CctxStatusReduced } from '@blockscout/zetachain-cctx-types';
|
|
|
|
import StatusTag, { type StatusTagType } from 'ui/shared/statusTag/StatusTag';
|
|
|
|
type Props = {
|
|
status: CctxStatusReduced;
|
|
isLoading?: boolean;
|
|
type?: 'reduced' | 'full';
|
|
};
|
|
|
|
const ZetaChainCCTXReducedStatus = ({ status, isLoading, type = 'reduced' }: Props) => {
|
|
let statusTagType: StatusTagType;
|
|
switch (status) {
|
|
case CctxStatusReduced.SUCCESS:
|
|
statusTagType = 'ok';
|
|
break;
|
|
case CctxStatusReduced.PENDING:
|
|
statusTagType = 'pending';
|
|
break;
|
|
case CctxStatusReduced.FAILED:
|
|
statusTagType = 'error';
|
|
break;
|
|
case CctxStatusReduced.UNRECOGNIZED:
|
|
statusTagType = 'pending';
|
|
break;
|
|
}
|
|
|
|
if (type === 'full') {
|
|
let text: string;
|
|
switch (status) {
|
|
case CctxStatusReduced.SUCCESS:
|
|
text = 'Success';
|
|
break;
|
|
case CctxStatusReduced.PENDING:
|
|
text = 'Pending';
|
|
break;
|
|
case CctxStatusReduced.FAILED:
|
|
text = 'Failed';
|
|
break;
|
|
case CctxStatusReduced.UNRECOGNIZED:
|
|
text = 'Unrecognized';
|
|
break;
|
|
}
|
|
return <StatusTag type={ statusTagType } text={ text } size="md" loading={ isLoading }/>;
|
|
}
|
|
|
|
return <StatusTag type={ statusTagType } size="sm" loading={ isLoading }/>;
|
|
};
|
|
|
|
export default ZetaChainCCTXReducedStatus;
|