Add editing to call details pane
This commit is contained in:
parent
95209689a8
commit
cee2788654
22 changed files with 330 additions and 118 deletions
44
ts/components/CallLinkRestrictionsSelect.tsx
Normal file
44
ts/components/CallLinkRestrictionsSelect.tsx
Normal file
|
@ -0,0 +1,44 @@
|
|||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import React from 'react';
|
||||
import {
|
||||
CallLinkRestrictions,
|
||||
toCallLinkRestrictions,
|
||||
} from '../types/CallLink';
|
||||
import type { LocalizerType } from '../types/I18N';
|
||||
import { Select } from './Select';
|
||||
|
||||
export type CallLinkRestrictionsSelectProps = Readonly<{
|
||||
i18n: LocalizerType;
|
||||
id?: string;
|
||||
value: CallLinkRestrictions;
|
||||
onChange: (value: CallLinkRestrictions) => void;
|
||||
}>;
|
||||
|
||||
export function CallLinkRestrictionsSelect({
|
||||
i18n,
|
||||
id,
|
||||
value,
|
||||
onChange,
|
||||
}: CallLinkRestrictionsSelectProps): JSX.Element {
|
||||
return (
|
||||
<Select
|
||||
id={id}
|
||||
value={String(value)}
|
||||
moduleClassName="CallLinkRestrictionsSelect"
|
||||
options={[
|
||||
{
|
||||
value: String(CallLinkRestrictions.None),
|
||||
text: i18n('icu:CallLinkRestrictionsSelect__Option--Off'),
|
||||
},
|
||||
{
|
||||
value: String(CallLinkRestrictions.AdminApproval),
|
||||
text: i18n('icu:CallLinkRestrictionsSelect__Option--On'),
|
||||
},
|
||||
]}
|
||||
onChange={nextValue => {
|
||||
onChange(toCallLinkRestrictions(nextValue));
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue