/* eslint-disable no-console */ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 import React from 'react'; import { Modal, ModalHeader, ModalBody, ModalButtonGroup, ModalButton, } from 'amazon-chime-sdk-component-library-react'; import './ChannelModals.css'; export const ViewChannelDetailsModal = ({ onClose, channel, moderators, channelFlow}) => { const modNames = moderators.map((m) => (
{m.Moderator.Name}
)); return (
{!channel.SubChannelId && ( <>
Channel Name
{channel.Name}
{moderators.length > 0 ? (
Moderators
{modNames}
) : null}
Privacy
{channel.Privacy === 'PRIVATE' && ( Private (non-members can read and send messages) )} {channel.Privacy === 'PUBLIC' && ( Public (only members can read and send messages) )}
Mode
{channel.Mode === 'RESTRICTED' && ( Restricted (administrators and moderators can add members) )} {channel.Mode === 'UNRESTRICTED' && ( Unrestricted (any member can add other members) )}
)} {channel.SubChannelId && ( <>
Sub Channel Id
{channel.SubChannelId}
Members Count
{channel.MembershipCount}
)} {channel.ElasticChannelConfiguration && ( <>
Maximum SubChannels
{channel.ElasticChannelConfiguration.MaximumSubChannels}
Target Memberships Per SubChannel
{channel.ElasticChannelConfiguration.TargetMembershipsPerSubChannel}
Scale-In Minimum Memberships(%)
{channel.ElasticChannelConfiguration.MinimumMembershipPercentage}
)} {!channel.SubChannelId && !channel.ElasticChannelConfiguration && (
Channel Flow
{channel.ChannelFlowArn == null ? No flow configured : {channelFlow.Name} }
) }
, ]} />
); }; export default ViewChannelDetailsModal;