/* * 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 { themeBorder, themeColor, themeShadow } from 'design-system'; import * as React from 'react'; import ListFooter from '../../../components/controls/ListFooter'; import { Issue, Paging } from '../../../types/types'; import SubnavigationIssue from './SubnavigationIssue'; import SubnavigationIssueComponentName from './SubnavigationIssueComponentName'; import SubnavigationIssuesListHeader from './SubnavigationIssuesListHeader'; interface Props { fetchMoreIssues: () => void; issues: Issue[]; loading: boolean; loadingMore: boolean; onFlowSelect: (index?: number) => void; onIssueSelect: (issueKey: string) => void; onLocationSelect: (index: number) => void; paging: Paging | undefined; selected: string | undefined; selectedFlowIndex: number | undefined; selectedLocationIndex: number | undefined; } export default function SubnavigationIssuesList(props: Props) { const { issues, loading, loadingMore, paging, selected, selectedFlowIndex, selectedLocationIndex, } = props; return ( {issues.map((issue, index) => { const previousIssue = index > 0 ? issues[index - 1] : undefined; const displayComponentName = !previousIssue || previousIssue.component !== issue.component; return ( {displayComponentName && (
  • )}
    ); })}
    {paging && paging.total > 0 && ( )}
    ); } const StyledList = styled.ul` li:not(:last-child) { border-bottom: ${themeBorder('default')}; } `; const StyledWrapper = styled.div` background-color: ${themeColor('filterbar')}; height: inherit; display: flex; flex-direction: column; `; const StyledFooter = styled(ListFooter)` box-shadow: ${themeShadow('scrolling')}; `;