Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2493 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2493 Rev 2494
Línea 2... Línea 2...
2
import { DataGrid } from '@mui/x-data-grid'
2
import { DataGrid } from '@mui/x-data-grid'
3
import { Box, Button } from '@mui/material'
3
import { Box, Button } from '@mui/material'
Línea 4... Línea 4...
4
 
4
 
5
import { ParadigmsContext } from '@app/contexts/paradigms'
5
import { ParadigmsContext } from '@app/contexts/paradigms'
-
 
6
import Widget from '@app/components/UI/Widget'
Línea 6... Línea 7...
6
import Widget from '@app/components/UI/Widget'
7
import ParadigmsModal from './ParadigmsModal'
7
 
8
 
Línea 8... Línea 9...
8
export default function Paradigms() {
9
export default function Paradigms() {
9
  const { paradigms, toggleModal } = useContext(ParadigmsContext)
10
  const { paradigms, toggleModal } = useContext(ParadigmsContext)
10
 
11
 
11
  const columns = [
12
  const columns = [
Línea 12... Línea 13...
12
    { field: 'id', headerName: 'ID', width: 70 },
13
    { field: 'id', headerName: 'ID', width: 70 },
-
 
14
    { field: 'description', headerName: 'Descripción' }
13
    { field: 'description', headerName: 'Descripción' }
15
  ]
14
  ]
16
 
15
 
17
  return (
16
  return (
18
    <>
17
    <Widget>
19
      <Widget>
18
      <Widget.Header title='Paradigmas' />
20
        <Widget.Header title='Paradigmas' />
19
      <Widget.Body>
21
        <Widget.Body>
20
        <Box
22
          <Box
21
          sx={{
23
            sx={{
-
 
24
              display: 'flex',
22
            display: 'flex',
25
              alignItems: 'center',
23
            alignItems: 'center',
26
              justifyContent: 'end',
24
            justifyContent: 'end',
27
              gap: 1,
25
            gap: 1
28
              marginBottom: 2
26
          }}
29
            }}
27
        >
30
          >
28
          <Button onClick={toggleModal}>Agregar</Button>
31
            <Button onClick={toggleModal}>Agregar</Button>
29
        </Box>
32
          </Box>
30
        <DataGrid
33
          <DataGrid
31
          rows={paradigms}
34
            rows={paradigms}
32
          columns={columns}
35
            columns={columns}
33
          initialState={{
36
            initialState={{
34
            pagination: {
37
              pagination: {
35
              paginationModel: { page: 0, pageSize: 10 }
38
                paginationModel: { page: 0, pageSize: 10 }
36
            }
39
              }
37
          }}
40
            }}
-
 
41
            pageSizeOptions={[10]}
-
 
42
          />
38
          pageSizeOptions={[10]}
43
        </Widget.Body>
39
        />
44
      </Widget>