mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
feat: info icon instances for 2 days (#6373)
This commit is contained in:
parent
ba2b90af42
commit
9a12257568
@ -6,6 +6,7 @@ import { FC, useLayoutEffect, useRef, useState } from 'react';
|
||||
import { ApplicationOverviewSchema } from '../../openapi';
|
||||
import { useRequiredPathParam } from '../../hooks/useRequiredPathParam';
|
||||
import { WarningAmberRounded } from '@mui/icons-material';
|
||||
import { HelpIcon } from '../common/HelpIcon/HelpIcon';
|
||||
|
||||
const StyledTable = styled('table')(({ theme }) => ({
|
||||
fontSize: theme.fontSizes.smallerBody,
|
||||
@ -196,7 +197,18 @@ export const ApplicationChart = ({ data }: IApplicationChartProps) => {
|
||||
<StyledTable>
|
||||
<tbody>
|
||||
<tr>
|
||||
<StyledCell>Instances:</StyledCell>
|
||||
<StyledCell
|
||||
sx={{ display: 'flex' }}
|
||||
>
|
||||
Instances:{' '}
|
||||
<HelpIcon
|
||||
size={
|
||||
theme.fontSizes
|
||||
.smallBody
|
||||
}
|
||||
tooltip='Active instances in the last 2 days'
|
||||
/>
|
||||
</StyledCell>
|
||||
<StyledCell>
|
||||
{environment.instanceCount}
|
||||
</StyledCell>
|
||||
|
@ -2,7 +2,8 @@ import { styled, Tooltip, TooltipProps } from '@mui/material';
|
||||
import { HelpOutline } from '@mui/icons-material';
|
||||
import { HtmlTooltip } from 'component/common/HtmlTooltip/HtmlTooltip';
|
||||
|
||||
const StyledContainer = styled('span')(({ theme }) => ({
|
||||
const StyledContainer = styled('span')<{ size: string | undefined }>(
|
||||
({ theme, size }) => ({
|
||||
display: 'inline-grid',
|
||||
alignItems: 'center',
|
||||
outline: 0,
|
||||
@ -16,17 +17,19 @@ const StyledContainer = styled('span')(({ theme }) => ({
|
||||
color: theme.palette.primary.main,
|
||||
},
|
||||
'& svg': {
|
||||
fontSize: theme.fontSizes.mainHeader,
|
||||
fontSize: size || theme.fontSizes.mainHeader,
|
||||
color: theme.palette.action.active,
|
||||
marginLeft: theme.spacing(0.5),
|
||||
},
|
||||
}));
|
||||
}),
|
||||
);
|
||||
|
||||
interface IHelpIconProps {
|
||||
tooltip: React.ReactNode;
|
||||
htmlTooltip?: boolean;
|
||||
placement?: TooltipProps['placement'];
|
||||
children?: React.ReactNode;
|
||||
size?: string;
|
||||
}
|
||||
|
||||
export const HelpIcon = ({
|
||||
@ -34,11 +37,12 @@ export const HelpIcon = ({
|
||||
htmlTooltip,
|
||||
placement,
|
||||
children,
|
||||
size,
|
||||
}: IHelpIconProps) => {
|
||||
if (htmlTooltip) {
|
||||
return (
|
||||
<HtmlTooltip title={tooltip} placement={placement} arrow>
|
||||
<StyledContainer tabIndex={0} aria-label='Help'>
|
||||
<StyledContainer size={size} tabIndex={0} aria-label='Help'>
|
||||
{children ?? <HelpOutline />}
|
||||
</StyledContainer>
|
||||
</HtmlTooltip>
|
||||
@ -47,7 +51,7 @@ export const HelpIcon = ({
|
||||
|
||||
return (
|
||||
<Tooltip title={tooltip} placement={placement} arrow>
|
||||
<StyledContainer tabIndex={0} aria-label='Help'>
|
||||
<StyledContainer size={size} tabIndex={0} aria-label='Help'>
|
||||
{children ?? <HelpOutline />}
|
||||
</StyledContainer>
|
||||
</Tooltip>
|
||||
|
Loading…
Reference in New Issue
Block a user