<?php
    /**
     * About Section
     * 
     * @package Blog Bee Pro
     * @since 1.0.0
     */
    namespace BBE\Customizer\Section;

    use BBE\Customizer\Section\Section as Section;
    use BBE\Customizer\Theme_Defaults as Theme_Defaults;

    use function esc_html__;
    use function esc_url;

    if( ! class_exists( __NAMESPACE__ . '\\About' ) ) {
        /**
         * About class
         */
        class About extends Section {
            /**
             * Section Id
             * 
             * @since 1.0.0
             * @var string
             */
            public static $id = 'bbe-about';

            /**
             * Register controls
             * 
             * @since 1.0.0
             */
            public function register_controls() {
                $this->add_section( 'about_section' );
                $this->add_control( 'site_documentation_info' );
                $this->add_control( 'site_support_info' );
            }

            /**
             * Settings
             * 
             * @since 1.0.0
             */
            public function get_settings( $id = '' ) {
                $settings = [
                    'site_documentation_info' =>  [
                        'default'   =>  Theme_Defaults::get_defaults( $id )
                    ],
                    'site_support_info' =>  [
                        'default'   =>  Theme_Defaults::get_defaults( $id )
                    ],
                ];
                return $id ? $settings[ $id ] : $settings;
            }

            /**
             * Controls
             * 
             * @since 1.0.0
             */
            public function get_controls( $id = '' ) {
                $controls = [
                    'about_section' =>  [
                        'title' =>  esc_html__( 'About Theme', 'blog-bee' ),
                        'priority' =>  1,
                    ],
                    'site_documentation_info' =>  [
                        'label' => esc_html__( 'Theme Documentation', 'blog-bee' ),
                        'description' => esc_html__( 'We have well prepared documentation which includes overall instructions and recommendations that are required in this theme.', 'blog-bee' ),
                        'type'  =>  'info-box',
                        'choices' => [
                            [
                                'label' => esc_html__( 'View Documentation', 'blog-bee' ),
                                'url'   => esc_url( '//doc.blazethemes.com/blog-bee' )
                            ]
                        ]
                    ],
                    'site_support_info'   =>  [
                        'label' => esc_html__( 'Theme Support', 'blog-bee' ),
                        'description' => esc_html__( 'We provide 24/7 support regarding any theme issue. Our support team will help you to solve any kind of issue. Feel free to contact us.', 'blog-bee' ),
                        'type'  =>  'info-box',
                        'choices' => [
                            [
                                'label' => esc_html__( 'Support Form', 'blog-bee' ),
                                'url'   => esc_url( '//blazethemes.com/support' )
                            ]
                        ]
                    ],
                ];
                return $id ? $controls[ $id ] : $controls;
            }

            /**
             * Defaults
             * 
             * @since 1.0.0
             */
            public function set_defaults() {
                Theme_Defaults::update_theme_defaults( [
                    'site_documentation_info'   =>  '',
                    'site_support_info' =>  '',
                ] );
            }

            /**
             * Get dynamic css args
             * 
             * @since 1.0.0
             */
            public function get_dynamic_css_args(){}

            /**
             * Render HTML
             * 
             * @since 1.0.0
             */
            public function render_html() {}
        }
        About::get_instance();
    }