Portal/rsconcept/frontend/src/components/info/SelectedCounter.tsx

22 lines
575 B
TypeScript
Raw Normal View History

2024-06-07 20:17:03 +03:00
import Overlay from '@/components/ui/Overlay';
interface SelectedCounterProps {
totalCount: number;
selectedCount: number;
position?: string;
hideZero?: boolean;
}
function SelectedCounter({ totalCount, selectedCount, hideZero, position = 'top-0 left-0' }: SelectedCounterProps) {
if (selectedCount === 0 && hideZero) {
return null;
}
return (
<Overlay position={`px-2 ${position}`} className='select-none whitespace-nowrap cc-blur rounded-xl'>
Выбор {selectedCount} из {totalCount}
</Overlay>
);
}
export default SelectedCounter;