ghost-portal/packages/page-broker/src/Overview/Workplan.tsx
Daria 859ba4800e
Coretime Broker on Coretime Chain - Update after Coretime Polkadot release (#10947)
* showing all cores, not relying on the core information in workload to show the cores

* swapped idles and pools to reflect correct values

* added start and end for bulk coretime, taking into account timeslice from the workplan

* checked and updated the time estimation function

* added cores offerred vs sold in summary

* filters turned back on

* lint

* reversed a change in a file from .github folder

* removed some extra checks

* minor refactor
2024-09-26 17:25:22 +08:00

51 lines
1.1 KiB
TypeScript

// Copyright 2017-2024 @polkadot/app-broker authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { RegionInfo } from '@polkadot/react-hooks/types';
import type { InfoRow } from '../types.js';
import React from 'react';
import { Spinner } from '@polkadot/react-components';
import WorkInfoRow from './WorkInfoRow.js';
interface Props {
className?: string;
workplanData: InfoRow;
currentTimeSlice: number
isExpanded: boolean
region: RegionInfo | undefined
}
function Workplan ({ isExpanded, workplanData }: Props): React.ReactElement<Props> {
if (!workplanData) {
return (
<tr
className={` ${isExpanded ? 'isExpanded isLast' : 'isCollapsed'}`}
style={{ minHeight: '100px' }}
>
<td> <Spinner /> </td>
<td colSpan={6}></td>
</tr>
);
}
return (
<>
{workplanData && (
<tr
className={` ${isExpanded ? 'isExpanded isLast' : 'isCollapsed'}`}
key={workplanData.core}
>
<WorkInfoRow data={workplanData} />
<td />
</tr>
)}
</>
);
}
export default React.memo(Workplan);