File tree Expand file tree Collapse file tree
src/pages/cadastro/Categoria Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ function CadastroCategoria() {
3838 } ) ;
3939 } , [ ] ) ;
4040
41+ function handleDelete ( btn ) {
42+ btn . target . closest ( 'tr' ) . remove ( ) ;
43+ }
44+
4145 function listDescriptionAsList ( description ) {
4246 return ( description . map ( ( media ) => (
4347 < li key = { `${ media } ` } >
@@ -138,10 +142,17 @@ function CadastroCategoria() {
138142 </ ul >
139143 </ td >
140144 < td className = "btnUD" >
141- < BtnUpDel style = { { background : 'blue' } } > < i className = "fas fa-edit" /> </ BtnUpDel >
145+ < BtnUpDel style = { { background : 'blue' } } >
146+ < i className = "fas fa-edit" />
147+ </ BtnUpDel >
142148 </ td >
143149 < td className = "btnUD" >
144- < BtnUpDel style = { { background : 'red' , paddingRight : '12px' , paddingLeft : '12px' } } > < i className = "fas fa-trash-alt" /> </ BtnUpDel >
150+ < BtnUpDel
151+ style = { { background : 'red' , paddingRight : '12px' , paddingLeft : '12px' } }
152+ onClick = { handleDelete }
153+ >
154+ < i className = "fas fa-trash-alt" />
155+ </ BtnUpDel >
145156 </ td >
146157 </ tr >
147158 ) ) }
You can’t perform that action at this time.
0 commit comments