Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 1757 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1757 Rev 3694
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react';
2
import { Link } from 'react-router-dom'
2
import { Link } from 'react-router-dom';
3
import {
3
import {
4
  IconButton,
4
  IconButton,
5
  Paper,
5
  styled,
6
  Table,
6
  Table,
7
  TableBody,
7
  TableBody,
8
  TableCell,
8
  TableCell,
9
  TableContainer,
-
 
10
  TableHead,
9
  TableHead,
11
  TableRow,
10
  TableRow,
12
  Typography,
11
  Typography,
13
  styled,
12
  TableContainer,
14
  tableCellClasses
13
  Paper
15
} from '@mui/material'
14
} from '@mui/material';
16
import { Visibility } from '@mui/icons-material'
15
import Visibility from '@mui/icons-material/Visibility';
-
 
16
 
-
 
17
import { tableCellClasses } from '@mui/material';
Línea 17... Línea 18...
17
 
18
 
18
const StyledTableCell = styled(TableCell)(() => ({
19
const StyledTableCell = styled(TableCell)(() => ({
19
  borderColor: 'var(--font-color)',
20
  borderColor: 'var(--font-color)',
20
  [`&.${tableCellClasses.head}`]: {
21
  [`&.${tableCellClasses.head}`]: {
Línea 23... Línea 24...
23
  [`&.${tableCellClasses.body}`]: {
24
  [`&.${tableCellClasses.body}`]: {
24
    position: 'relative',
25
    position: 'relative',
25
    borderRight: '1px solid',
26
    borderRight: '1px solid',
26
    fontWeight: '500'
27
    fontWeight: '500'
27
  }
28
  }
28
}))
29
}));
Línea 29... Línea 30...
29
 
30
 
30
export default function ReportTable({ reports = [] }) {
31
export default function ReportTable({ reports = [] }) {
31
  if (!reports || reports.length === 0) {
32
  if (!reports || reports.length === 0) {
32
    return <Typography variant='h2'>No hay reportes disponibles</Typography>
33
    return <Typography variant='h2'>No hay reportes disponibles</Typography>;
Línea 33... Línea 34...
33
  }
34
  }
34
 
-
 
35
  return (
-
 
36
    <TableContainer
35
 
37
      component={Paper}
-
 
38
      sx={{ border: '1px solid var(--font-color)' }}
36
  return (
39
    >
37
    <TableContainer component={Paper} sx={{ border: '1px solid var(--font-color)' }}>
40
      <Table sx={{ minWidth: 650 }} aria-label='simple table'>
38
      <Table sx={{ minWidth: 650 }} aria-label='simple table'>
41
        <TableHead>
39
        <TableHead>
42
          <TableRow>
40
          <TableRow>
Línea 49... Línea 47...
49
            <StyledTableCell align='center'>Acciones</StyledTableCell>
47
            <StyledTableCell align='center'>Acciones</StyledTableCell>
50
          </TableRow>
48
          </TableRow>
51
        </TableHead>
49
        </TableHead>
52
        <TableBody>
50
        <TableBody>
53
          {reports.map(
51
          {reports.map(
54
            (
-
 
55
              {
-
 
56
                first_name,
-
 
57
                last_name,
52
            ({ first_name, last_name, email, status, reason, type, date, actions }, key) => (
58
                email,
-
 
59
                status,
-
 
60
                reason,
-
 
61
                type,
-
 
62
                date,
-
 
63
                actions
-
 
64
              },
-
 
65
              key
-
 
66
            ) => (
-
 
67
              <TableRow
53
              <TableRow
68
                key={key}
54
                key={key}
69
                sx={{
55
                sx={{
70
                  '& td:last-child': { borderRight: 0 },
56
                  '& td:last-child': { borderRight: 0 },
71
                  '&:last-child td, &:last-child th': { borderBottom: 0 }
57
                  '&:last-child td, &:last-child th': { borderBottom: 0 }
Línea 88... Línea 74...
88
            )
74
            )
89
          )}
75
          )}
90
        </TableBody>
76
        </TableBody>
91
      </Table>
77
      </Table>
92
    </TableContainer>
78
    </TableContainer>
93
  )
79
  );
94
}
80
}