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