Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 1751 | Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1750 stevensc 1
import {
2
  Avatar,
3
  Button,
4
  Card,
5
  CardActions,
6
  CardContent,
7
  CardHeader,
8
  Collapse,
9
  Typography
10
} from '@mui/material'
11
import React, { useState } from 'react'
12
 
13
export default function ReportCard({ report }) {
14
  const {
15
    first_name = '',
16
    last_name = '',
17
    email = '',
18
    image = '',
19
    status = '',
20
    reason = '',
21
    type = '',
22
    commet = '',
23
    review = null,
24
    date = ''
25
  } = report
26
  const [expanded, setExpanded] = useState(false)
27
 
28
  const handleExpandClick = () => {
29
    setExpanded(!expanded)
30
  }
31
 
32
  return (
33
    <Card sx={{ maxWidth: 345 }}>
34
      <CardHeader
35
        avatar={<Avatar src={image} alt={name} />}
36
        title={`${first_name} ${last_name}`}
37
        subheader={date}
38
      />
39
 
40
      <CardContent>
41
        <Typography variant='body2'>Tipo: {type}</Typography>
42
        <Typography variant='body2'>Motivo: {reason}</Typography>
43
        <Typography variant='body2'>Estatus: {status}</Typography>
44
        <Typography variant='body2'>Email: {email}</Typography>
45
      </CardContent>
46
 
47
      <CardActions>
48
        <Button size='small' onClick={handleExpandClick}>
49
          Detalles
50
        </Button>
51
      </CardActions>
52
 
53
      <Collapse in={expanded} timeout='auto' unmountOnExit>
54
        <CardContent>
55
          <Typography paragraph>{commet}</Typography>
56
        </CardContent>
57
      </Collapse>
58
    </Card>
59
  )
60
}