{({isExpanded, showMoreButton}) => (
{filteredIncidents.map((incident, idx) => {
if (idx >= COLLAPSE_COUNT && !isExpanded) {
return null;
}
return (
);
})}
{showMoreButton}
)}
);
}
export default MetricHistory;
const StyledPanelTable = styled(PanelTable)<{expanded: boolean; isEmpty: boolean}>`
grid-template-columns: max-content 1fr repeat(2, max-content);
& > div {
padding: ${space(1)} ${space(2)};
}
div:last-of-type {
padding: ${p => p.isEmpty && `48px ${space(1)}`};
}
${p =>
!p.expanded &&
css`
margin-bottom: 0px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
border-bottom: none;
`}
`;
const StyledDateTime = styled(DateTime)`
color: ${p => p.theme.gray300};
`;
const Cell = styled('div')`
display: flex;
align-items: center;
white-space: nowrap;
font-size: ${p => p.theme.fontSizeMedium};
padding: ${space(1)};
`;