Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3152 | Rev 3154 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3152 Rev 3153
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react'
2
import { List as MuiList, ListItem as MuiListItem } from '@mui/material'
2
import { List as MuiList, ListItem as MuiListItem } from '@mui/material'
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
import EmptySection from '@components/UI/EmptySection'
4
import EmptySection from '@components/UI/EmptySection'
-
 
5
 
-
 
6
export default function List({
-
 
7
  items = [],
-
 
8
  emptyMessage = 'No hay elementos para mostrar',
5
 
9
  renderItem = () => {}
6
export default function List({ items = [], renderItem = () => {} }) {
10
}) {
7
  if (!items.length) {
11
  if (!items.length) {
Línea 8... Línea 12...
8
    return <EmptySection message='No hay paradigmas para mostrar' />
12
    return <EmptySection message={emptyMessage} />
9
  }
13
  }
10
 
14
 
11
  return (
15
  return (
12
    <MuiList>
-
 
13
      {items.map((item, index) => (
-
 
14
        <MuiListItem key={item.id ?? index}>
16
    <MuiList>
15
          {items.map((item) => renderItem(item))}
17
      {items.map((item, index) => (
16
        </MuiListItem>
18
        <MuiListItem key={item.id ?? index}>{renderItem(item)}</MuiListItem>
17
      ))}
19
      ))}