Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rm mocks NO-DATA [CHAIN-451] #27

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/components/ProofStatus.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from 'react'

import { Status } from './Status'
import { Text } from './Text'

interface ProofStatusProps {
status: 'success' | 'failed'
}

export const ProofStatus: React.FC<ProofStatusProps> = ({ status }) => {
if (status === 'success') {
return (
<Status color="green">
<Text color="white" weight={800} size={10} uppercase>
Success
</Text>
</Status>
)
}

if (status === 'failed') {
return (
<Status color="red">
<Text color="white" weight={800} size={10} uppercase>
Failed
</Text>
</Status>
)
}

return (
<Status color="red">
<Text color="white" weight={800} size={10} uppercase>
undefined
</Text>
</Status>
)
}
13 changes: 8 additions & 5 deletions src/pages/compute-unit/ComputeUnitProofsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ProofBasic } from '@fluencelabs/deal-ts-clients/dist/dealExplorerClient

import { A } from '../../components/A'
import { Pagination } from '../../components/Pagination'
import { ProofStatus } from '../../components/ProofStatus.tsx'
import { Space } from '../../components/Space'
import {
Cell,
Expand All @@ -32,7 +33,7 @@ const template = [
'minmax(10px, 1fr)',
'minmax(10px, 1fr)',
'minmax(10px, 1fr)',
'150px',
'200px',
]

interface ComputeUnitProofsTableProps {
Expand Down Expand Up @@ -84,7 +85,7 @@ export const ComputeUnitProofsTable: React.FC<ComputeUnitProofsTableProps> = ({
>
Timestamp
</TableColumnTitleWithSort>
<TableColumnTitle align="center">Status</TableColumnTitle>
<TableColumnTitle>Status</TableColumnTitle>
</TableHeader>
<TableBody
isEmpty={!pageItems.length}
Expand Down Expand Up @@ -127,7 +128,7 @@ const ProofRow: React.FC<ProofRowProps> = ({ proof }) => {
<Row template={template}>
{/* Epoch */}
<Cell>
<Text size={12}>[NO DATA]</Text>
<Text size={12}>{proof.createdAtEpoch}</Text>
</Cell>
{/* Tx */}
<Cell>
Expand All @@ -140,8 +141,10 @@ const ProofRow: React.FC<ProofRowProps> = ({ proof }) => {
<Text size={12}>{createdAt.date}</Text>
<Text size={12}>{createdAt.time}</Text>
</Cell>
{/* Status */}
<Cell>[NO DATA]</Cell>
{/* Status: currently only submitted (success) proofs returned from DealExplorerClient. */}
<Cell>
<ProofStatus status="success" />
</Cell>
</Row>
</RowTrigger>
</RowHeader>
Expand Down