Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev Autor Línea Nro. Línea
3577 stevensc 1
import React from 'react';
2
import { Grid, Typography } from '@mui/material';
3
import { useFetch } from '@shared/hooks';
4
 
5
import { Card, CardHeader, List, Spinner } from '@shared/components';
6
 
7
export function InmailPage() {
8
  const { data: conversations, loading } = useFetch('/inmail');
9
 
3578 stevensc 10
  if (loading || !conversations) {
3577 stevensc 11
    return <Spinner />;
12
  }
13
 
14
  return (
15
    <Grid container spacing={2}>
16
      <Grid item xs={12} md={3}>
17
        <Typography variant='h3'>Conversaciones</Typography>
18
        <List
19
          items={conversations}
20
          keyExtractor={(item) => item.uuid}
21
          emptyMessage='No hay conversaciones'
22
          renderItem={(conversation) => (
23
            <Card>
24
              <CardHeader
25
                avatar={conversation.image}
26
                title={conversation.name}
27
                subheader={conversation.last_message}
28
              />
29
            </Card>
30
          )}
31
        />
32
      </Grid>
33
      <Grid item xs={12} md={9}>
34
        <Typography variant='h3'>Mensajes</Typography>
35
      </Grid>
36
    </Grid>
37
  );
38
}