import React from 'react'; import { FileIcon, FolderOutlineIcon } from '../../../components/icons'; interface SelectionSummaryProps { documentCount?: number; folderCount?: number; totalCount?: number; } const SelectionSummary: React.FC = ({ documentCount = 0, folderCount = 0, totalCount = 0 }) => { const docCount = Number(documentCount) || 0; const folderCountNumber = Number(folderCount) || 0; const aggregateCount = docCount + folderCountNumber; const resolvedTotal = Number(totalCount) || aggregateCount; if (!docCount && !folderCountNumber && !resolvedTotal) { return null; } const tokens = []; if (docCount) { tokens.push({ key: 'documents', count: docCount, icon: , }); } if (folderCountNumber) { tokens.push({ key: 'folders', count: folderCountNumber, icon: , }); } if (!tokens.length) { const count = resolvedTotal; return ( {`${count} item${count === 1 ? '' : 's'}`} ); } return ( {tokens.map((token, index) => ( {index > 0 ? ยท : null} {token.count} {token.icon} ))} ); }; export default SelectionSummary;