Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3694 Rev 3719
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 { Button } from '@mui/material';
3
import { Button } from '@mui/material';
4
import Add from '@mui/icons-material/Add';
4
import Add from '@mui/icons-material/Add';
5
 
5
 
6
import { useGoals } from '@hooks';
6
import { useGoals } from '@hooks';
7
 
7
 
8
import List from '@components/common/list';
8
import List from '@components/common/list';
9
import GoalItem from '@components/habits/goals/goal-item';
9
import GoalItem from '@components/habits/goals/goal-item';
10
import PageHeader from '@components/common/page-header';
10
import PageHeader from '@components/common/page-header';
11
import LoadingWrapper from '@components/common/loading-wrapper';
11
import LoadingWrapper from '@components/common/loading-wrapper';
12
 
12
 
13
export default function GoalsPage() {
13
export default function GoalsPage() {
14
  const { goals, loading } = useGoals();
14
  const { goals, loading } = useGoals();
15
 
15
 
16
  return (
16
  return (
17
    <>
17
    <>
18
      <PageHeader
18
      <PageHeader
19
        title='Metas'
19
        title='Metas'
20
        action={() => (
20
        action={() => (
21
          <Button LinkComponent={Link} to='create'>
21
          <Button LinkComponent={Link} to='create'>
22
            <Add />
22
            <Add />
23
            Agregar
23
            Agregar
24
          </Button>
24
          </Button>
25
        )}
25
        )}
26
      />
26
      />
27
      <LoadingWrapper loading={loading}>
27
      <LoadingWrapper loading={loading}>
28
        <List
28
        <List
29
          emptyMessage='No hay metas para mostrar'
29
          emptyMessage='No hay metas para mostrar'
30
          items={goals}
30
          items={goals}
31
          renderItem={(goal) => <GoalItem goal={goal} />}
31
          renderItem={(goal) => <GoalItem goal={goal} />}
32
        />
32
        />
33
      </LoadingWrapper>
33
      </LoadingWrapper>
34
    </>
34
    </>
35
  );
35
  );
36
}
36
}