
import React, { FunctionComponent } from 'react';
import { IStyledProps } from '../../../../common/types';
import { TextStyle, ViewStyle } from 'react-native';
import { addNewCall } from '../../../../../store/pbx/pbxSlice';
import { AddNewCallButtonView } from './AddNewCallButtonView';
import { IPbxCall } from '../../../../../store/pbx/types';
import { useAppDispatch } from '../../../../../store/hooks';
interface IProps extends IStyledProps<{ icon?: TextStyle, container?: ViewStyle }> {
    iconCallName?: string;
    call: IPbxCall;
}

export const AddNewCallButton: FunctionComponent<IProps> = ({ call, iconCallName, style }) => {
    const dispatch = useAppDispatch();
    const addSecondCall = () => {
        dispatch(addNewCall());
    };

    return <AddNewCallButtonView onPress={addSecondCall} call={call} callIconName={iconCallName} style={style} />;
};
