<?php

/**
 * Free Showcase Twitter
 */

namespace Simple_Giveaways;

if ( ! defined( 'ABSPATH' ) ) {
	return;
}

if ( ! class_exists( '\Simple_Giveaways\SG_Twitter_Dummy' ) ) {
	class SG_Twitter_Dummy extends GA_Integration {

		/**
		 * Active Indicator
		 *
		 * @var boolean
		 */
		public $active = false;

		/**
		 * Integration Image
		 *
		 * @var string
		 */
		public $image = '';

		/**
		 * Integration Title
		 *
		 * @var string
		 */
		public $title = '';

		/**
		 * Integration Description
		 *
		 * @var string
		 */
		public $desc = '';

		/**
		 * Setting initial params
		 */
		public function __construct() {

			$this->title       = __( 'Twitter', 'giveasap' );
			$this->settings_id = 'sg_twitter_integration';
			$this->image       = untrailingslashit( GASAP_URI ) . '/includes/integrations/assets/twitter.svg';
			$this->desc        = __( 'Enable people to receive entries with Twitter.', 'giveasap' );
		}

		public function buttons( $integrations ) {
			echo '<a href="' . esc_url( giv_fs()->get_upgrade_url() ) . '" class="button button-primary">' . esc_html__( 'Upgrade to PRO', 'giveasap' ) . '</a>';
		}

		/**
		 * Get Categories
		 *
		 * @return string[]
		 */
		public function get_categories() {
			return [
				'social',
			];
		}

	}
}

add_filter( 'giveasap_integrations', '\Simple_Giveaways\sg_register_twitter_integration' );

/**
 * Registering Twitter
 *
 * @return array
 */
function sg_register_twitter_integration( $integrations ) {

	$integrations['sg_twitter_integration'] = '\Simple_Giveaways\SG_Twitter_Dummy';

	return $integrations;
}
