mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
23 lines
834 B
TypeScript
23 lines
834 B
TypeScript
|
import { useInstanceStatus } from 'hooks/api/getters/useInstanceStatus/useInstanceStatus';
|
||
|
import React, { FC } from 'react';
|
||
|
import { InstanceStatusBar } from 'component/common/InstanceStatus/InstanceStatusBar';
|
||
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||
|
|
||
|
export const InstanceStatus: FC = ({ children }) => {
|
||
|
const { instanceStatus } = useInstanceStatus();
|
||
|
|
||
|
return (
|
||
|
<div hidden={!instanceStatus} style={{ height: '100%' }}>
|
||
|
<ConditionallyRender
|
||
|
condition={Boolean(instanceStatus)}
|
||
|
show={() => (
|
||
|
<InstanceStatusBarMemo instanceStatus={instanceStatus!} />
|
||
|
)}
|
||
|
/>
|
||
|
{children}
|
||
|
</div>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
const InstanceStatusBarMemo = React.memo(InstanceStatusBar);
|