Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3529 | Rev 3661 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3481 stevensc 1
import React from 'react';
2
import { Avatar, Box, Typography } from '@mui/material';
3
 
3529 stevensc 4
import { useFetch } from '@shared/hooks';
5
import { Spinner } from '@shared/components';
6
import { DetailTag } from '@microlearning/components';
3481 stevensc 7
 
3505 stevensc 8
export function ProfilePage() {
3529 stevensc 9
  const { data, loading } = useFetch('/microlearning/profile');
3481 stevensc 10
 
3530 stevensc 11
  if (loading || !data) return <Spinner />;
3481 stevensc 12
 
13
  return (
14
    <>
15
      <Box textAlign='center'>
16
        <Avatar
17
          src={data[0]?.image}
18
          alt={data[0]?.name}
19
          sx={{ width: 100, height: 100, margin: '0 auto' }}
20
        />
21
        <Typography variant='h2'>{data[0]?.name}</Typography>
22
      </Box>
23
 
24
      <Box display='flex' flexDirection='column' gap={1} width='100%' mt={2}>
25
        {data[0]?.details?.map(({ uuid, label, value }) => (
26
          <DetailTag key={uuid} title={label} label={value} />
27
        ))}
28
      </Box>
29
    </>
30
  );
3505 stevensc 31
}