Skip to content

Commit

Permalink
feat(WorkerStatus): update worker status text (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
MixailE authored Nov 12, 2024
1 parent a5ef6aa commit 03298d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/WorkerStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const WorkerStatus: React.FC<WorkerStatusProps> = ({
return (
<Status color="grey200">
<Text color="grey500" weight={800} size={10} uppercase>
Waiting...
Waiting registration
</Text>
</Status>
)
Expand Down
16 changes: 9 additions & 7 deletions src/pages/deal/MatchingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { useApiQuery } from '../../hooks'
import { formatHexData } from '../../utils/helpers'

const template = [
'30px',
'minmax(10px, 1fr)',
'minmax(10px, 1fr)',
'minmax(10px, 1fr)',
Expand All @@ -45,6 +46,7 @@ export const MatchingTable: React.FC<MatchingTableProps> = ({ dealId }) => {
<>
<ScrollableTable>
<TableHeader template={template}>
<TableColumnTitle>#</TableColumnTitle>
<TableColumnTitle>Worker Id</TableColumnTitle>
<TableColumnTitle>Provider Id</TableColumnTitle>
<TableColumnTitle>Compute Unit</TableColumnTitle>
Expand All @@ -56,8 +58,8 @@ export const MatchingTable: React.FC<MatchingTableProps> = ({ dealId }) => {
isLoading={isLoading}
noDataText="No found any workers"
>
{data?.data.map((worker) => (
<WorkerDetailRow key={worker.id} worker={worker} />
{data?.data.map((worker, index) => (
<WorkerDetailRow key={worker.id} worker={worker} index={index} />
))}
</TableBody>
</ScrollableTable>
Expand All @@ -66,29 +68,29 @@ export const MatchingTable: React.FC<MatchingTableProps> = ({ dealId }) => {
}
interface WorkerDetailRowProps {
worker: WorkerDetail
index: number
}

const WorkerDetailRow: React.FC<WorkerDetailRowProps> = ({ worker }) => {
const WorkerDetailRow: React.FC<WorkerDetailRowProps> = ({ worker, index }) => {
return (
<RowBlock>
<RowHeader>
<RowTrigger>
<Row template={template}>
{/* # */}
<Cell>
<Text size={12}>{index + 1}</Text>
</Cell>
<Cell>
<Text size={12}>{formatHexData(worker.id, 10, 10)}</Text>
</Cell>
{/* Provider ID */}
<Cell>
<A href={`/provider/${worker.providerId}`}>
{formatHexData(worker.providerId, 10, 10)}
</A>
</Cell>
{/* Compute Unit */}
<Cell>
<ShrinkText size={12}>{worker.cuCount}</ShrinkText>
</Cell>
{/* Status */}
<Cell>
<WorkerStatus hasOffChainId={!!worker.offchainWorkerId} />
</Cell>
Expand Down

0 comments on commit 03298d2

Please sign in to comment.