api 17.0.1, extension 0.64.1, phishing 0.25.26, vanitygen 0.63.21. The api major renames two sets of generated lookup types - assigner_coretime moved under scheduler:: and the vstaging candidate receipt was promoted to V9 - so the imports for those follow. Metadata v16 also carries deprecation info, so the deliberate compat usages of preimage.statusFor and treasury.spendLocal now need explicit eslint-disable lines.
30 lines
862 B
TypeScript
30 lines
862 B
TypeScript
// Copyright 2017-2026 @polkadot/react-query authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { PolkadotRuntimeParachainsSchedulerAssignerCoretimeCoreDescriptor } from '@polkadot/types/lookup';
|
|
|
|
import React from 'react';
|
|
|
|
import { useApi, useCall } from '@polkadot/react-hooks';
|
|
|
|
interface Props {
|
|
children?: React.ReactNode;
|
|
className?: string;
|
|
query: string;
|
|
}
|
|
|
|
function BrokerStatus ({ children, className = '', query }: Props): React.ReactElement<Props> {
|
|
const { api } = useApi();
|
|
const status = useCall<PolkadotRuntimeParachainsSchedulerAssignerCoretimeCoreDescriptor>(api.query.broker?.status);
|
|
const strStatus = status === undefined ? '' : status.toJSON()[query];
|
|
|
|
return (
|
|
<div className={className}>
|
|
{strStatus?.toString()}
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default React.memo(BrokerStatus);
|