// Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import { ConversationType } from '../../../state/ducks/conversations'; import { LocalizerType } from '../../../types/Util'; import { getAccessControlOptions } from '../../../util/getAccessControlOptions'; import { AccessControlClass } from '../../../textsecure.d'; import { PanelRow } from './PanelRow'; import { PanelSection } from './PanelSection'; export type PropsType = { accessEnum: typeof AccessControlClass.AccessRequired; conversation?: ConversationType; i18n: LocalizerType; setAccessControlAttributesSetting: (value: number) => void; setAccessControlMembersSetting: (value: number) => void; }; export const GroupV2Permissions: React.ComponentType = ({ accessEnum, conversation, i18n, setAccessControlAttributesSetting, setAccessControlMembersSetting, }) => { if (conversation === undefined) { throw new Error('GroupV2Permissions rendered without a conversation'); } const updateAccessControlAttributes = ( event: React.ChangeEvent ) => { setAccessControlAttributesSetting(Number(event.target.value)); }; const updateAccessControlMembers = ( event: React.ChangeEvent ) => { setAccessControlMembersSetting(Number(event.target.value)); }; const accessControlOptions = getAccessControlOptions(accessEnum, i18n); return ( } /> } /> ); };