@@ -14,48 +14,43 @@ interface Props {
1414 onDelete : ( id : string ) => void ;
1515}
1616
17- export const EmployeeListComponent : React . FunctionComponent < Props > = ( {
18- employeeList,
19- onCreate,
20- onEdit,
21- onDelete,
22- } ) => {
17+ export const EmployeeListComponent : React . FunctionComponent < Props > = props => {
18+ const { employeeList, onCreate, onEdit, onDelete } = props ;
2319 const { filteredList, onSearch, search } = useSearchBar ( employeeList , [
2420 'name' ,
2521 ] ) ;
2622
2723 const renderContent = ( { itemName } ) => {
2824 return (
29- < div >
25+ < >
3026 ¿Seguro que quiere borrar a < strong > { itemName } </ strong > ?
31- </ div >
27+ </ >
3228 ) ;
3329 } ;
30+
3431 return (
35- < >
36- < TableContainer
37- columns = { [ 'Activo' , 'Id' , 'Nombre' , 'Email' , 'Fecha último incurrido' ] }
38- rows = { filteredList }
39- rowRenderer = { ( rowProps : RowRendererProps < Employee > ) => (
40- < EmployeeRowComponent { ...rowProps } />
41- ) }
42- onCreate = { onCreate }
43- onEdit = { onEdit }
44- onDelete = { onDelete }
45- labels = { {
46- searchPlaceholder : 'Buscar empleado' ,
47- createButton : 'Nuevo empleado' ,
48- deleteTitle : 'Eliminar Empleado' ,
49- deleteContent : props => renderContent ( props ) ,
50- closeButton : 'Cancelar' ,
51- acceptButton : 'Aceptar' ,
52- } }
53- enableSearch = { true }
54- search = { search }
55- onSearch = { onSearch }
56- enablePagination = { true }
57- pageSize = { 5 }
58- />
59- </ >
32+ < TableContainer
33+ columns = { [ 'Activo' , 'Id' , 'Nombre' , 'Email' , 'Fecha último incurrido' ] }
34+ rows = { filteredList }
35+ rowRenderer = { ( rowProps : RowRendererProps < Employee > ) => (
36+ < EmployeeRowComponent { ...rowProps } />
37+ ) }
38+ onCreate = { onCreate }
39+ onEdit = { onEdit }
40+ onDelete = { onDelete }
41+ labels = { {
42+ searchPlaceholder : 'Buscar empleado' ,
43+ createButton : 'Nuevo empleado' ,
44+ deleteTitle : 'Eliminar Empleado' ,
45+ deleteContent : props => renderContent ( props ) ,
46+ closeButton : 'Cancelar' ,
47+ acceptButton : 'Aceptar' ,
48+ } }
49+ enableSearch = { true }
50+ search = { search }
51+ onSearch = { onSearch }
52+ enablePagination = { true }
53+ pageSize = { 5 }
54+ />
6055 ) ;
6156} ;
0 commit comments