ConceptPortal-public/rsconcept/frontend/src/components/SelectedCounter.tsx

22 lines
564 B
TypeScript
Raw Normal View History

import Overlay from '@/components/ui/Overlay';
2023-12-04 14:19:54 +03:00
interface SelectedCounterProps {
totalCount: number;
selectedCount: number;
2023-12-28 14:04:44 +03:00
position?: string;
hideZero?: boolean;
2023-12-04 14:19:54 +03:00
}
function SelectedCounter({ totalCount, selectedCount, hideZero, position = 'top-0 left-0' }: SelectedCounterProps) {
if (selectedCount === 0 && hideZero) {
2023-12-04 14:19:54 +03:00
return null;
}
return (
2023-12-30 19:43:24 +03:00
<Overlay position={`px-2 ${position}`} className='select-none whitespace-nowrap clr-app'>
Выбор {selectedCount} из {totalCount}
2023-12-28 14:04:44 +03:00
</Overlay>
);
2023-12-04 14:19:54 +03:00
}
2023-12-28 14:04:44 +03:00
export default SelectedCounter;