<?php

namespace UltraguardPro\modules\authenticator\pages;

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

use UltraguardPro\Plugin;
use UltraguardPro\modules\core\BasePage;

class TwoFactorPage extends BasePage {

    public function __construct( Plugin $plugin ) {
        parent::__construct( $plugin );
    }

    public function get_scheme( $context ): array {
        // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only admin view routing.
        $view = sanitize_key( wp_unslash( $_GET['view'] ?? 'dashboard'  ) );

        if ( 'settings' === $view ) {
            return ( new TwoFactorSettings( $this->plugin ) )->get_scheme( $context );
        }

        return ( new TwoFactorDashboard( $this->plugin ) )->get_scheme( $context );
    }
}
