Files
explore/ui/shared/zetaChain/ZetaChainCCTXReducedStatus.tsx
Igor StuevandGitHub 0f4e29e4d0 zeta chain cctx (#2904)
* 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
2025-09-05 15:53:00 +02:00

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;