<?php
// Location: /pwa/components/pwa_header.php
if (!isset($role))   { $role = 'solar'; }
if (!isset($page))   { $page = 'dashboard'; }

$roleTitleMap = [
    'solar'     => 'SolarDoot',
    'captain'   => 'Captain',
    'statehead' => 'State Head',
];

$pageTitleMap = [
    'dashboard' => 'Dashboard',
    'customers' => 'Customers',
    'followups' => 'Follow-ups',
    'tasks'     => 'Tasks',
    'settings'  => 'Settings',
];

$roleLabel = $roleTitleMap[$role]   ?? 'SolarDoot';
$pageLabel = $pageTitleMap[$page]   ?? 'Dashboard';
?>
<header class="pwa-header" data-role="<?php echo htmlspecialchars($role); ?>">
    <div class="pwa-header-left">
        <div class="pwa-logo-circle"><img src="/assets/logos/Atulya_Logo.png" alt="Logo" class="pwa-logo-circle"></div>
        <div class="pwa-header-text">
            <div class="pwa-app-name"><?php echo htmlspecialchars($_SESSION['team']['full_name'])?> CRM</div>
            <div class="pwa-role-name"><?php echo htmlspecialchars($roleLabel); ?></div>
        </div>
    </div>
    <div class="pwa-header-right">
        <span class="pwa-page-title"><?php echo htmlspecialchars($pageLabel); ?></span>
    </div>
</header>
