<?php
/**
 * Admin page rendering the parsed PHP error log table (F2).
 * WP_List_Table is instantiated lazily inside render(), never in __construct().
 *
 * @package ConflictRadar\Admin
 */

declare( strict_types=1 );

namespace ConflictRadar\Admin;

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

class ErrorLogPage {

	public function render(): void {
		if ( ! current_user_can( 'manage_options' ) ) {
			wp_die( esc_html__( 'Unauthorized', 'conflict-radar' ) );
		}

		$table = new ErrorLogTable(); // Lazy: here, not in the constructor.
		$table->prepare_items();

		require CONFLICT_RADAR_DIR . 'templates/admin/error-log.php';
	}
}
