@@ -16,7 +16,7 @@ import {
16
16
Stack ,
17
17
Typography
18
18
} from '@mui/material'
19
- import { IconTrash , IconX } from '@tabler/icons'
19
+ import { IconEraser , IconTrash , IconX } from '@tabler/icons'
20
20
import PerfectScrollbar from 'react-perfect-scrollbar'
21
21
22
22
import { BackdropLoader } from 'ui-component/loading/BackdropLoader'
@@ -113,6 +113,10 @@ const ManageScrapedLinksDialog = ({ show, dialogProps, onCancel, onSave }) => {
113
113
setSelectedLinks ( links )
114
114
}
115
115
116
+ const handleRemoveAllLinks = ( ) => {
117
+ setSelectedLinks ( [ ] )
118
+ }
119
+
116
120
const handleSaveLinks = ( ) => {
117
121
onSave ( url , selectedLinks )
118
122
}
@@ -145,6 +149,7 @@ const ManageScrapedLinksDialog = ({ show, dialogProps, onCancel, onSave }) => {
145
149
/>
146
150
</ FormControl >
147
151
< Button
152
+ disabled = { ! url }
148
153
sx = { { borderRadius : '12px' , mt : 1 , display : 'flex' , flexShrink : 0 } }
149
154
size = 'small'
150
155
variant = 'contained'
@@ -154,7 +159,21 @@ const ManageScrapedLinksDialog = ({ show, dialogProps, onCancel, onSave }) => {
154
159
</ Button >
155
160
</ Stack >
156
161
</ Box >
157
- < Typography sx = { { mb : 2 , fontWeight : 500 } } > Scraped Links</ Typography >
162
+ < Box sx = { { display : 'flex' , alignItems : 'center' , justifyContent : 'space-between' , mb : 1.5 } } >
163
+ < Typography sx = { { fontWeight : 500 } } > Scraped Links</ Typography >
164
+ { selectedLinks . length > 0 ? (
165
+ < StyledButton
166
+ sx = { { height : 'max-content' , width : 'max-content' } }
167
+ variant = 'outlined'
168
+ color = 'error'
169
+ title = 'Clear All Links'
170
+ onClick = { handleRemoveAllLinks }
171
+ startIcon = { < IconEraser /> }
172
+ >
173
+ Clear All
174
+ </ StyledButton >
175
+ ) : null }
176
+ </ Box >
158
177
< >
159
178
{ loading && < BackdropLoader open = { loading } /> }
160
179
{ selectedLinks . length > 0 ? (
0 commit comments