ghost-portal/packages/page-broker/src/Overview/Workplan.tsx
Daria 468a3d5107
Feedback/#11253 (#11304)
* countdown component

* filtering by parachain id in workplan and workload

* lint

* rename chainName to relayName, fixed subscan block link

* always showing price even if the cores are sold out

* moved some calculations to the coretime context

* added broker context for page-broker, fix for wrong dates

* showing time with the estimated date in places

* removed extra code when calculating renewal status

* tsc for page-broker

* page-coretime tsc

* fix showing correct dates for fixed price phase in sale history

* minified workinforow as all rows show the same information now

* default values for fn input

* showing start price of the sale on the sale tab

* replaced custom Countdown element with existing implementation

* adjusted estimateTime function for broker

* adjusted estimateTime function for coretime page

* lint

* added Renewal link for RegionX
2025-04-04 12:01:20 +13:00

48 lines
1.0 KiB
TypeScript

// Copyright 2017-2025 @polkadot/app-broker authors & contributors
// SPDX-License-Identifier: Apache-2.0
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;
isExpanded: boolean
}
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={7}></td>
</tr>
);
}
return (
<>
{workplanData && (
<tr
className={` ${isExpanded ? 'isExpanded isLast' : 'isCollapsed'}`}
key={workplanData.core}
>
<WorkInfoRow data={workplanData} />
<td />
</tr>
)}
</>
);
}
export default React.memo(Workplan);