<?php

namespace Bright_Deposits_For_WooCommerce\Setup;

/**
 * @package Bright_Deposits_For_WooCommerce\Setup
 * @since 1.0.0
 * @author Bright Plugins
 * Description: This class is responsible for setting up the admin menu for the plugin.
 */
class AdminMenu {

	public function __construct() {
		add_action( 'admin_menu', array( $this, 'bp_admin_menu' ) );
		add_action( 'admin_menu', array( $this, 'later' ), 99 );
	}

	/**
	 * Add the admin menu for the plugin.
	 * @since 1.0.0
	 * @return void
	 */
	public function bp_admin_menu() {
		$menu_args = apply_filters( 'bdfwbp_admin_menu_args', array(
			'page_title' => 'Bright Plugins',
			'menu_title' => 'Bright Plugins',
			'capability' => 'manage_options',
			'menu_slug'  => 'brightplugins',
			'function'   => null,
			'icon_url'   => BDFWBP_ASSETS . '/img/bp-logo-icon.png',
			'position'   => 60,
		) );

		add_menu_page( ...array_values( $menu_args ) );
	}

	/**
	 * Remove the submenu page for the plugin.
	 * @since 1.0.0
	 * @return void
	 */
	public function later() {
		remove_submenu_page( 'brightplugins', 'brightplugins' );
	}


}