huridocs/uwazi

View on GitHub
app/react/Permissions/components/MemberListItemInfo.tsx

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import React from 'react';
import { Icon } from 'app/UI';
import { MemberWithPermission } from 'shared/types/entityPermisions';
import { PermissionType } from 'shared/types/permissionSchema';

interface MemberListItemProps {
  value: MemberWithPermission;
}

const iconsMap = {
  [PermissionType.USER]: 'user',
  [PermissionType.GROUP]: 'users',
  [PermissionType.PUBLIC]: 'globe-africa',
};

export const MemberListItemInfo = ({ value: { type, label } }: MemberListItemProps) => (
  <div className="member-list-item">
    <div className="round-icon">
      <Icon icon={iconsMap[type]} />
    </div>
    <span>{label}</span>
  </div>
);