<?php

namespace RadiusTheme\RadiusBooking\Elementor\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;

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

class AppointmentFormWidget extends Widget_Base {

	public function get_name() {
		return 'rtrb_appointment_form';
	}

	public function get_title() {
		return esc_html__( 'Appointment Form', 'radius-booking' );
	}

	public function get_icon() {
		return 'rtrb-icon-booking';
	}

	public function get_categories() {
		return array( 'radius-booking' );
	}

	public function get_keywords() {
		return array( 'appointment', 'booking', 'form', 'schedule', 'radius' );
	}

	protected function register_controls() {
		$this->start_controls_section(
			'section_content',
			array(
				'label' => esc_html__( 'Settings', 'radius-booking' ),
				'tab'   => Controls_Manager::TAB_CONTENT,
			)
		);

		$this->add_control(
			'info_notice',
			array(
				'type'            => Controls_Manager::RAW_HTML,
				'raw'             => esc_html__( 'This widget renders the Appointment Booking Form. Customize the form appearance from Radius Booking > Settings > Form Customization.', 'radius-booking' ),
				'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
			)
		);

		$this->end_controls_section();
	}

	protected function render() {
		echo do_shortcode( '[radius_booking_form]' );
	}
}
