Files
explore/ui/tx/fheOperations/TxFHEOperationsTableItem.tsx
3478c3fa51 feat: FHE operations and tags (#3180)
* integrate erc-7984

* minor fix

* FHE operations and tags

* upd

* upd

* fix mobile

* upd

* fix mobile

* Update TxFHEOperations.tsx

* upd

* add hover text

* Update Address.tsx

* Update Address.tsx

* add hover text

* Revert "Merge branch 'both-prs' into fhe-operations"

This reverts commit a8d48de2c077fed37581948ad07576ec751d2003, reversing
changes made to f253cae03dc71d38c3fa92fcad29f7be11467521.

* fix design of fhe ops page

* fix design of fhe ops page

* fix design of fhe ops page

* fix design of fhe ops page

* fix comments

* fix: tab name

* upd

---------

Co-authored-by: Maksym Zub <[email protected]>
2026-02-24 11:27:32 +01:00

72 lines
2.3 KiB
TypeScript

import { Text } from '@chakra-ui/react';
import { capitalize } from 'es-toolkit';
import React from 'react';
import type { FheOperation } from 'types/api/fheOperations';
import { Badge } from 'toolkit/chakra/badge';
import { Skeleton } from 'toolkit/chakra/skeleton';
import { TableCell, TableRow } from 'toolkit/chakra/table';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import { getTypeColor } from 'ui/tx/fheOperations/utils';
type Props = FheOperation & { isLoading?: boolean };
const TxFHEOperationsTableItem = (props: Props) => {
const { log_index: logIndex, operation, type, fhe_type: fheType, is_scalar: isScalar, hcu_cost: hcuCost, hcu_depth: hcuDepth, caller, isLoading } = props;
const hcuDepthValue = hcuDepth;
return (
<TableRow>
<TableCell verticalAlign="middle">
<Skeleton loading={ isLoading }>
{ logIndex }
</Skeleton>
</TableCell>
<TableCell verticalAlign="middle">
<Skeleton loading={ isLoading }>
{ operation }
</Skeleton>
</TableCell>
<TableCell verticalAlign="middle">
<Badge colorPalette={ getTypeColor(type) } loading={ isLoading }>
{ capitalize(type) }
</Badge>
</TableCell>
<TableCell verticalAlign="middle">
<Badge colorPalette="gray" loading={ isLoading }>
{ fheType }
</Badge>
</TableCell>
<TableCell verticalAlign="middle">
<Badge colorPalette="gray" loading={ isLoading }>
{ isScalar ? 'Scalar' : 'Non-scalar' }
</Badge>
</TableCell>
<TableCell verticalAlign="middle">
<Skeleton loading={ isLoading }>
{ hcuCost.toLocaleString() }
</Skeleton>
</TableCell>
<TableCell verticalAlign="middle">
<Skeleton loading={ isLoading } color="text.secondary">
{ hcuDepthValue.toLocaleString() }
</Skeleton>
</TableCell>
<TableCell verticalAlign="middle">
{ caller && caller.hash ? (
<AddressEntity
address={ caller }
truncation="dynamic"
isLoading={ isLoading }
/>
) : (
<Text color="text.secondary">—</Text>
) }
</TableCell>
</TableRow>
);
};
export default React.memo(TxFHEOperationsTableItem);