This commit is contained in:
PotapovaA 2026-08-12 13:31:20 +03:00
parent b84ec6fcd2
commit ba1933c333

View File

@ -36,6 +36,12 @@ const ModalExport = ({ open, onClose, ssps = [], loading = false }) => {
}); });
}; };
const allSspsSelected = ssps.length > 0 && ssps.every((ssp) => selectedSsps.includes(ssp.id));
const handleAllSspsToggle = () => {
setSelectedSsps(allSspsSelected ? [] : ssps.map((ssp) => ssp.id));
};
const handleExport = async () => { const handleExport = async () => {
if (selectedSsps.length > 0) { if (selectedSsps.length > 0) {
try { try {
@ -97,6 +103,18 @@ const ModalExport = ({ open, onClose, ssps = [], loading = false }) => {
height='2.5rem' height='2.5rem'
/> />
<FormControlLabel
control={<Checkbox checked={allSspsSelected} onChange={handleAllSspsToggle} disabled={loading || ssps.length === 0} size='16' />}
label='Выбрать все ССП'
sx={{
mx: 1,
my: 1,
display: 'flex',
flexDirection: 'row',
gap: '.75rem',
}}
/>
{/* Список ССП с галочками */} {/* Список ССП с галочками */}
{filteredSsps.length === 0 && searchTerm && ( {filteredSsps.length === 0 && searchTerm && (
<Box <Box