Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2900 | Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
2899 stevensc 1
import React, { useMemo } from 'react'
2
import { styled } from '@mui/material'
3
import { REACTIONS } from '@constants/feed'
4
 
5
const ReactionsGroup = styled('div')(() => ({
6
  display: 'flex',
7
  alignItems: 'center',
8
  cursor: 'pointer'
9
}))
10
 
11
export default function ReactionsIcons({ reactions = [] }) {
12
  const icons = useMemo(
13
    () =>
14
      REACTIONS.filter(({ type }) =>
15
        reactions.some(({ reaction }) => type === reaction)
16
      ),
17
    [reactions]
18
  )
19
 
20
  return (
21
    <ReactionsGroup>
22
      {icons.map(({ icon: Icon, color, label }) => (
23
        <Icon key={label} style={{ color }} />
24
      ))}
25
    </ReactionsGroup>
26
  )
27
}