Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 6830 Rev 6832
Línea 1... Línea -...
1
/* eslint-disable react/prop-types */
-
 
2
import React, { useEffect, useState } from 'react'
1
import React, { useEffect, useState } from 'react'
3
import axios from '../../../../utils/axios'
2
import { axios } from '../../../utils'
4
import Avatar from '../../../../shared/Avatar/Avatar'
3
import Avatar from '../../UI/AvatarImage'
5
import EmptySection from '../../../../shared/empty-section/EmptySection'
4
import EmptySection from '../../UI/EmptySection'
-
 
5
import { useSelector } from 'react-redux'
6
import ExpandLessIcon from '@mui/icons-material/ExpandLess'
6
import ExpandLessIcon from '@mui/icons-material/ExpandLess'
7
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
7
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
Línea 8... Línea 8...
8
 
8
 
9
const GroupsInfo = ({
9
const GroupsInfo = ({
Línea 12... Línea 12...
12
  display = false,
12
  display = false,
13
}) => {
13
}) => {
14
  const [widgetData, setWidgetData] = useState([])
14
  const [widgetData, setWidgetData] = useState([])
15
  const [displayMenu, setDisplayMenu] = useState(display)
15
  const [displayMenu, setDisplayMenu] = useState(display)
16
  const [lookMore, setLookMore] = useState(false)
16
  const [lookMore, setLookMore] = useState(false)
-
 
17
  const labels = useSelector(({ intl }) => intl.labels)
Línea 17... Línea 18...
17
 
18
 
18
  const getData = () => {
19
  const getData = () => {
19
    axios.get(url).then(({ data: response }) => {
20
    axios.get(url).then(({ data: response }) => {
20
      const { success, data } = response
21
      const { success, data } = response
Línea 61... Línea 62...
61
                <span>{name}</span>
62
                <span>{name}</span>
62
              </a>
63
              </a>
63
            </li>
64
            </li>
64
          ))
65
          ))
65
        ) : (
66
        ) : (
66
          <EmptySection message={LABELS.DATATABLE_EMPTY} />
67
          <EmptySection message={labels.empty} />
67
        )}
68
        )}
Línea 68... Línea 69...
68
 
69
 
69
        {widgetData.length >= 3 && (
70
        {widgetData.length >= 3 && (
70
          <li
71
          <li
71
            className="helper__list-item justify-content-center cursor-pointer py-2"
72
            className="helper__list-item justify-content-center cursor-pointer py-2"
72
            onClick={() => setLookMore(!lookMore)}
73
            onClick={() => setLookMore(!lookMore)}
73
          >
74
          >
74
            <span>{lookMore ? LABELS.VIEW_LESS : LABELS.VIEW_MORE}</span>
75
            <span>{lookMore ? labels.view_less : labels.view_more}</span>
75
          </li>
76
          </li>
76
        )}
77
        )}
77
      </ul>
78
      </ul>
78
    </div>
79
    </div>