ghost-portal/packages/react-query/src/BrokerStatus.tsx
Daria 519127d567
Fix: Error on Coretime on Polkadot due to no data coming from Coretime API (#10910)
* added placeholders for when no data is available

* linter warning
2024-09-11 08:49:37 -04:00

26 lines
560 B
TypeScript

// Copyright 2017-2024 @polkadot/react-query authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React from 'react';
import { useBrokerStatus } from '@polkadot/react-hooks';
interface Props {
children?: React.ReactNode;
className?: string;
query: string;
}
function BrokerStatus ({ children, className = '', query }: Props): React.ReactElement<Props> {
const info = useBrokerStatus(query) || '-';
return (
<div className={className}>
{info}
{children}
</div>
);
}
export default React.memo(BrokerStatus);