<?php
/**
 * Sub Tab Details Class
 *
 * This class manages and stores all sub-tab page details for the plugin's navigation menu.
 *
 * @package miniorange-sms-order-notification-otp-verification/objects
 */

namespace WCSMSOTP\Objects;

use WCSMSOTP\Traits\Instance;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Sub Tab Details Class
 *
 * This class manages and stores all sub-tab page details for the plugin's navigation menu.
 */
if ( ! class_exists( 'SubTabDetails' ) ) {
	/**
	 * Sub Tab Details Class
	 *
	 * This class manages and stores all sub-tab page details for the plugin's navigation menu.
	 */
	final class SubTabDetails {

		use Instance;

		/**
		 * Array of SubtabPageDetails Object detailing
		 * all the page menu options.
		 *
		 * @var array Array of sub-tab details indexed by tab key. Each value is an array of SubtabPageDetails objects.
		 */
		public $sub_tab_details;

		/**
		 * Array of SubtabPageDetails Object detailing
		 * all the notification page menu options.
		 *
		 * @var array Array of notification sub-tab details. Keys are tab constants, values are SubtabPageDetails objects.
		 */
		public $notification_sub_tab_details;

		/**
		 * Private constructor to avoid direct object creation.
		 *
		 * Initializes all sub-tab page details for the plugin navigation menu.
		 */
		private function __construct() {

			$this->notification_sub_tab_details = array(
				WcSubTabs::MOWC_WC_NOTIF    => new SubtabPageDetails(
					'Notifications',
					mowc_( 'WooCommerce' ),
					mowc_( 'WooCommerce' ),
					'sms-notifications.php',
					'WcNotifSubTab',
					'background:#D8D8D8'
				),
				WcSubTabs::MOWC_FORM_NOTIF  => new SubtabPageDetails(
					'Form Notifications',
					mowc_( 'Form' ),
					mowc_( 'Forms Notifications' ),
					'sms-notifications.php',
					'formNotifSubTab',
					'background:#D8D8D8'
				),
				WcSubTabs::MOWC_DOKAN_NOTIF => new SubtabPageDetails(
					'Dokan Notifications',
					mowc_( 'Dokan' ),
					mowc_( 'Dokan (Vendor)' ),
					'sms-notifications.php',
					'dokanNotifSubTab',
					'background:#D8D8D8'
				),
				WcSubTabs::MOWC_WCFM_NOTIF  => new SubtabPageDetails(
					'WCFM Notifications',
					mowc_( 'WCFM' ),
					mowc_( 'WCFM (Vendor)' ),
					'sms-notifications.php',
					'wcfmNotifSubTab',
					'background:#D8D8D8'
				),
			);

			$this->sub_tab_details = array(
				'mowcnotifications' => $this->notification_sub_tab_details,
			);
		}
	}
}
