// 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 { PanelRow } from './PanelRow'; import { PanelSection } from './PanelSection'; import { Select } from '../../Select'; export type PropsType = { conversation?: ConversationType; i18n: LocalizerType; setAccessControlAttributesSetting: (value: number) => void; setAccessControlMembersSetting: (value: number) => void; }; export const GroupV2Permissions: React.ComponentType = ({ conversation, i18n, setAccessControlAttributesSetting, setAccessControlMembersSetting, }) => { if (conversation === undefined) { throw new Error('GroupV2Permissions rendered without a conversation'); } const updateAccessControlAttributes = (value: string) => { setAccessControlAttributesSetting(Number(value)); }; const updateAccessControlMembers = (value: string) => { setAccessControlMembersSetting(Number(value)); }; const accessControlOptions = getAccessControlOptions(i18n); return ( } /> } /> ); };