import { IButtonProps, IStyledProps } from '../../../../common/types';
import React, { FunctionComponent } from 'react';
import { StyleSheet } from 'react-native';
import { IConference } from '../../../../../store/conference/types';
import Icon from 'react-native-vector-icons/Ionicons';

interface IProps extends IStyledProps<{ image?: any }>, IButtonProps {
    call: IConference
}
export const LockConfButtonView: FunctionComponent<IProps> = ({
    onPress,
    call,
    style
}) => {
    style = { ...defaultStyle, ...style };
    const iconStyle = { ...defaultStyle.image, ...style.image }
    const callIconName = (call.isLocked ? 'lock-closed-outline' : 'lock-open-outline');
    return (
        <Icon
            name={callIconName}
            style={iconStyle}
            onPress={onPress}
        />
    );
};

const defaultStyle = StyleSheet.create({
    image: {
        color: 'white',
        fontSize: 40,
        opacity: 1,
    },
});
