1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/frontend/src/component/menu/Footer/ApiDetails/ApiDetails.tsx

47 lines
1.4 KiB
TypeScript
Raw Normal View History

import { ReactElement } from 'react';
import ConditionallyRender from '../../../common/ConditionallyRender';
import {
formatCurrentVersion,
formatUpdateNotification,
IPartialUiConfig,
} from './apidetails.helpers';
interface IApiDetailsProps {
uiConfig: IPartialUiConfig;
}
export const ApiDetails = (props: IApiDetailsProps): ReactElement => {
const instanceId = props.uiConfig.versionInfo?.instanceId;
const currentVersion = formatCurrentVersion(props.uiConfig);
const environment = props.uiConfig.environment;
const updateNotification = formatUpdateNotification(props.uiConfig);
return (
<section title="API details">
<h4>
{currentVersion}{' '}
<ConditionallyRender
condition={Boolean(environment)}
show={<small>({environment})</small>}
/>
</h4>
<ConditionallyRender
condition={Boolean(updateNotification)}
show={
<small>
{updateNotification}
<br />
</small>
}
/>
<br />
<small>{props.uiConfig.slogan}</small>
<br />
<ConditionallyRender
condition={Boolean(instanceId)}
show={<small>{`${instanceId}`}</small>}
/>
</section>
);
};