2021-05-20 21:54:03 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { Button, ButtonVariant } from './Button';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { LocalizerType } from '../types/Util';
|
2021-05-20 21:54:03 +00:00
|
|
|
|
|
|
|
export type PropsType = {
|
|
|
|
i18n: LocalizerType;
|
|
|
|
onCloseController: () => unknown;
|
|
|
|
onStopSharing: () => unknown;
|
|
|
|
presentedSourceName: string;
|
|
|
|
};
|
|
|
|
|
2022-11-18 00:45:19 +00:00
|
|
|
export function CallingScreenSharingController({
|
2021-05-20 21:54:03 +00:00
|
|
|
i18n,
|
|
|
|
onCloseController,
|
|
|
|
onStopSharing,
|
|
|
|
presentedSourceName,
|
2022-11-18 00:45:19 +00:00
|
|
|
}: PropsType): JSX.Element {
|
2021-05-20 21:54:03 +00:00
|
|
|
return (
|
|
|
|
<div className="module-CallingScreenSharingController">
|
|
|
|
<div className="module-CallingScreenSharingController__text">
|
|
|
|
{i18n('calling__presenting--info', [presentedSourceName])}
|
|
|
|
</div>
|
|
|
|
<div className="module-CallingScreenSharingController__buttons">
|
2021-06-17 18:41:16 +00:00
|
|
|
<Button
|
|
|
|
className="module-CallingScreenSharingController__button"
|
|
|
|
onClick={onStopSharing}
|
|
|
|
variant={ButtonVariant.Destructive}
|
|
|
|
>
|
2021-05-20 21:54:03 +00:00
|
|
|
{i18n('calling__presenting--stop')}
|
|
|
|
</Button>
|
|
|
|
<button
|
|
|
|
aria-label={i18n('close')}
|
|
|
|
className="module-CallingScreenSharingController__close"
|
|
|
|
onClick={onCloseController}
|
|
|
|
type="button"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
2022-11-18 00:45:19 +00:00
|
|
|
}
|