|
@@ -1,6 +1,7 @@
|
1
|
1
|
import React from 'react';
|
2
|
|
-import { Row, Col, Button, Table } from 'react-bootstrap'
|
|
2
|
+import { Row, Col } from 'react-bootstrap'
|
3
|
3
|
import { Box } from '@mui/material';
|
|
4
|
+import toast, { Toaster } from 'react-hot-toast';
|
4
|
5
|
|
5
|
6
|
import ToggleButton from '@mui/material/ToggleButton';
|
6
|
7
|
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
|
|
@@ -21,7 +22,8 @@ import Editar from '../Components/Modal/EditPlaza';
|
21
|
22
|
import Eliminar from '../Components/Modal/EliminarPlaza';
|
22
|
23
|
import Mostrar from '../Components/Modal/MostrarPlaza';
|
23
|
24
|
|
24
|
|
-
|
|
25
|
+import { ListMode } from '../Components/Puestos/ListMode'
|
|
26
|
+
|
25
|
27
|
let data = [{
|
26
|
28
|
nombre : 'The standard Lorem Ipsum passage, used since the 1500s',
|
27
|
29
|
description : '"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."',
|
|
@@ -35,83 +37,14 @@ function* idMaker() {
|
35
|
37
|
yield index++;
|
36
|
38
|
}
|
37
|
39
|
|
|
40
|
+const Success = () => toast.success('Plaza Agregada!!')
|
|
41
|
+
|
38
|
42
|
var ID = idMaker();
|
39
|
43
|
|
40
|
44
|
for ( var _ of new Array(46) ){
|
41
|
45
|
data.push({ ...data[0], id : ID.next().value, d : _ })
|
42
|
46
|
}
|
43
|
47
|
|
44
|
|
-function ListMode(props) {
|
45
|
|
-
|
46
|
|
- let { setEdit, setDelete, setShow, setPuesto } = props;
|
47
|
|
-
|
48
|
|
- return(
|
49
|
|
- <Col md="12">
|
50
|
|
- <div className="body-table">
|
51
|
|
- <Table responsive borderless id="tablaproductos">
|
52
|
|
- <thead>
|
53
|
|
- <tr >
|
54
|
|
- <th className="text-center">Nombre de la plaza</th>
|
55
|
|
- <th className="text-center">Descripción</th>
|
56
|
|
- <th className="text-center">Salario</th>
|
57
|
|
- <th className="text-center">Acciones</th>
|
58
|
|
- </tr>
|
59
|
|
- </thead>
|
60
|
|
- <tbody>
|
61
|
|
-
|
62
|
|
- {
|
63
|
|
- data.length ?
|
64
|
|
- data.slice( 0,23 ).map( (plaza, i) => {
|
65
|
|
- return (
|
66
|
|
- <tr key={plaza.id}>
|
67
|
|
- <td className="text-center">{ plaza.id + " - " + plaza.nombre }</td>
|
68
|
|
- <td className="text-center">{ plaza.description }</td>
|
69
|
|
- <td className="text-center">{ plaza.salario }</td>
|
70
|
|
- <td className="actions_butons_plaza">
|
71
|
|
- <Button
|
72
|
|
- onClick={() => {
|
73
|
|
- setPuesto(plaza)
|
74
|
|
- setShow(true)
|
75
|
|
- }}
|
76
|
|
- className="ver_producto">Ver
|
77
|
|
- </Button>
|
78
|
|
-
|
79
|
|
- <Button
|
80
|
|
- onClick={() => {
|
81
|
|
- setPuesto(plaza)
|
82
|
|
- setEdit(true)
|
83
|
|
- }}
|
84
|
|
- className="editar_producto">Editar
|
85
|
|
- </Button>
|
86
|
|
- <Button
|
87
|
|
- onClick={() => {
|
88
|
|
- setPuesto(plaza)
|
89
|
|
- setDelete(true)
|
90
|
|
- }}
|
91
|
|
- className="eliminar_producto">Eliminar
|
92
|
|
- </Button>
|
93
|
|
- </td>
|
94
|
|
- </tr>
|
95
|
|
- )
|
96
|
|
- }) : undefined
|
97
|
|
- }
|
98
|
|
-
|
99
|
|
- </tbody>
|
100
|
|
- <tfoot>
|
101
|
|
- <tr>
|
102
|
|
- <th>Nombre de la plaza</th>
|
103
|
|
- <th>Descripción</th>
|
104
|
|
- <th>Salario</th>
|
105
|
|
- <th>Acciones</th>
|
106
|
|
- </tr>
|
107
|
|
- </tfoot>
|
108
|
|
- </Table>
|
109
|
|
- </div>
|
110
|
|
- </Col>
|
111
|
|
- )
|
112
|
|
-}
|
113
|
|
-
|
114
|
|
-
|
115
|
48
|
function GridMode (props) {
|
116
|
49
|
|
117
|
50
|
let { setEdit, setDelete, setShow, setPuesto } = props;
|
|
@@ -253,6 +186,7 @@ export function Puestos() {
|
253
|
186
|
<div className={`main_list_products ${alignment === 'list' ? 'activar_vista' : 'desactivar_vista'}`} id="list_view_products">
|
254
|
187
|
<Row>
|
255
|
188
|
<ListMode
|
|
189
|
+ data={data}
|
256
|
190
|
setPuesto={setPuesto}
|
257
|
191
|
setEdit={setEdit}
|
258
|
192
|
setDelete={setDelete}
|
|
@@ -262,12 +196,16 @@ export function Puestos() {
|
262
|
196
|
</div>
|
263
|
197
|
</div>
|
264
|
198
|
|
265
|
|
- <Express setExpress={setExpress} visible={expres} onClose={() => setExpress(false) } />
|
266
|
|
- <Manual setManual={setManual} visible={manual} onClose={() => setManual(false) } />
|
|
199
|
+ <Express success={Success} setExpress={setExpress} visible={expres} onClose={() => setExpress(false) } />
|
|
200
|
+ <Manual success={Success} setManual={setManual} visible={manual} onClose={() => setManual(false) } />
|
267
|
201
|
|
268
|
202
|
<Editar puesto={puesto} visible={edit} onClose={() => setEdit(false)} />
|
269
|
203
|
<Eliminar puesto={puesto} visible={del} onClose={() => setDelete(false)} />
|
270
|
204
|
<Mostrar puesto={puesto} visible={show} onClose={() => setShow(false)} />
|
|
205
|
+ <Toaster
|
|
206
|
+ position="bottom-right"
|
|
207
|
+ reverseOrder={false}
|
|
208
|
+ />
|
271
|
209
|
|
272
|
210
|
</div>
|
273
|
211
|
)
|