fix
This commit is contained in:
parent
b84ec6fcd2
commit
ba1933c333
@ -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 () => {
|
||||
if (selectedSsps.length > 0) {
|
||||
try {
|
||||
@ -97,6 +103,18 @@ const ModalExport = ({ open, onClose, ssps = [], loading = false }) => {
|
||||
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 && (
|
||||
<Box
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user