/* * SonarQube * Copyright (C) 2009-2024 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import styled from '@emotion/styled'; import { LinkHighlight, LinkStandalone } from '@sonarsource/echoes-react'; import classNames from 'classnames'; import { Badge, NoDataIcon, themeColor } from 'design-system'; import * as React from 'react'; import { Path } from 'react-router-dom'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { localizeMetric } from '../../../helpers/measures'; import { MetricKey } from '../../../types/metrics'; interface IssueMeasuresCardInnerProps extends React.HTMLAttributes { metric: MetricKey; value?: string; header: React.ReactNode; url: Path; failed?: boolean; icon?: React.ReactNode; disabled?: boolean; footer?: React.ReactNode; } export function IssueMeasuresCardInner(props: Readonly) { const { header, metric, icon, value, url, failed, footer, className, disabled, ...rest } = props; return (
{header} {failed && ( {translate('overview.measures.failed_badge')} )}
{value ?? '-'}
{value ? icon : }
{footer}
); } const ColorBold = styled.div` color: ${themeColor('pageTitle')}; `;