2023-03-01 18:26:56 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import * as HeaderButton from '../../../containers/HeaderButton';
|
|
|
|
import { useVideoConf } from '../../../lib/hooks/useVideoConf';
|
|
|
|
|
|
|
|
export default function HeaderCallButton({ rid }: { rid: string }): React.ReactElement | null {
|
2023-08-21 19:12:34 +00:00
|
|
|
const { showInitCallActionSheet, callEnabled, disabledTooltip } = useVideoConf(rid);
|
2023-03-01 18:26:56 +00:00
|
|
|
|
2023-08-21 19:12:34 +00:00
|
|
|
if (callEnabled)
|
|
|
|
return (
|
|
|
|
<HeaderButton.Item
|
|
|
|
disabled={disabledTooltip}
|
|
|
|
iconName='phone'
|
|
|
|
onPress={showInitCallActionSheet}
|
|
|
|
testID='room-view-header-call'
|
|
|
|
/>
|
|
|
|
);
|
2023-03-01 18:26:56 +00:00
|
|
|
return null;
|
|
|
|
}
|