//Modules
import React from 'react';

//Style
import "./Cta.css"

class CTA extends React.Component {
    constructor(props) {
        super(props);
    }

    render() {
        function ContentSwitch(props) {
            const BtnChecker = props.BTNText;
            const ContentChecker = props.ContentText;

            if (BtnChecker){
                return (<a className="AP-Btn-outline">{BtnChecker}</a>);
            }
            if (ContentChecker){
            return (<p>{ContentChecker}</p>);
            }
            else {
                return "";
            }
        }

        return (
            <div className="Cta mt-5">
                <div className="container">
                    <h1 className="mb-5">{this.props.title}</h1>
                    
                    <ContentSwitch BTNText={this.props.BtnText} ContentText={this.props.ContentText}/>
                </div>
            </div>
        )
    }
}

export default CTA;