<?php
// Wallet hub wrapper — routes to existing wallet pages based on role
require_once __DIR__ . '/../../core/auth.php';
require_login();
$role = current_user_role();

// Include sidebar
if ($role === 'admin') {
  @include __DIR__ . '/../../admin-nav.php';
} else {
  @include __DIR__ . '/../../landlord-nav.php';
}

if ($role === 'admin') {
  include_once __DIR__ . '/wallet-front.php';
  exit;
}

if ($role === 'landlord') {
  // Show landlord wallet tools
  include_once __DIR__ . '/../../wallet/landlord/history.php';
  exit;
}
if ($role === 'tenant') {
  // Show tenant wallet (deposit + history)
  include_once __DIR__ . '/../../wallet/tenant/deposit.php';
  exit;
}
http_response_code(403);
echo 'Access denied';
?>
