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

23 lines
525 B
TypeScript
Raw Normal View History

2023-12-04 14:19:54 +03:00
interface SelectedCounterProps {
total: number
selected: number
position?: string
hideZero?: boolean
}
function SelectedCounter({
total, selected, hideZero,
position = 'top-0 left-0',
} : SelectedCounterProps) {
if (selected === 0 && hideZero) {
return null;
}
return (
<div className='relative w-full z-pop'>
<div className={`absolute px-2 select-none whitespace-nowrap small-caps clr-app ${position}`}>
Выбор {selected} из {total}
</div>
</div>);
}
export default SelectedCounter;