Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2901 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3719 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')(({ theme }) => ({
6
  display: 'flex',
7
  alignItems: 'center',
8
  cursor: 'pointer',
9
  '& > svg:not(:first-of-type)': {
10
    marginLeft: theme.spacing(-0.7)
11
  }
12
}));
13
 
14
export default function ReactionsIcons({ reactions = [] }) {
15
  const icons = useMemo(
16
    () => REACTIONS.filter(({ type }) => reactions.some(({ reaction }) => type === reaction)),
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
}