// Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import React, { useState } from 'react'; import { Modal, ModalHeader, ModalBody, ModalButtonGroup, ModalButton, Input, Label, RadioGroup, } from 'amazon-chime-sdk-component-library-react'; import './NewChannelModal.css'; import { useAuthContext } from '../../providers/AuthProvider'; export const NewChannelModal = ({ onClose, onCreateChannel }) => { const [name, setName] = useState(''); const [privacy, setPrivacy] = useState('PRIVATE'); const [mode, setMode] = useState('RESTRICTED'); const { member } = useAuthContext(); const onNameChange = (e) => { setName(e.target.value); }; const onPrivacyChange = (e) => { setPrivacy(e.target.value); }; const onModeChange = (e) => { setMode(e.target.value); }; return (
onCreateChannel(e, name, mode, privacy)} id="new-channel-form" >
onNameChange(e)} />
onPrivacyChange(e)} />
{privacy !== 'PUBLIC' && (
onModeChange(e)} />
)}
, , ]} />
); }; export default NewChannelModal;