// SPDX-License-Identifier: AGPL-3.0-or-later import React from 'react'; import { ChevronRight as ChevR, Target } from '../../icons'; import EmptyState from '../EmptyState/EmptyState'; import SortTh from './SortTh'; import type { CredentialReuseRow, SortDir } from './types'; interface Props { rows: CredentialReuseRow[]; loading: boolean; sortCol: string; sortDir: SortDir; onSort: (col: string) => void; onSelect: (r: CredentialReuseRow) => void; } const ReuseTable: React.FC = ({ rows, loading, sortCol, sortDir, onSort, onSelect, }) => ( LAST SEENPRINCIPALKINDTARGETSATTEMPTS {rows.length > 0 ? rows.map((r) => { const isPlain = r.secret_kind === 'plaintext'; const moreDeckies = Math.max(0, r.deckies.length - 3); const moreServices = Math.max(0, r.services.length - 3); return ( onSelect(r)}> ); }) : ( )}
DECKIES SERVICES
{new Date(r.last_seen).toLocaleTimeString()} {r.principal ?? } {r.secret_kind.toUpperCase()} {r.target_count} {r.attempt_count} {r.deckies.slice(0, 3).map((d) => ( {d} ))} {moreDeckies > 0 && +{moreDeckies}} {r.services.slice(0, 3).map((s) => ( {s} ))} {moreServices > 0 && +{moreServices}}
); export default ReuseTable;