'', 'live' => '', 'chat' => '', 'pending' => '', 'companies' => '', 'bot-config' => '', 'conv-flow' => '', 'settings' => '', 'sync' => '', 'send' => '', ]; return $icons[$name] ?? ''; } public static function close(): string { return ''; } public static function open( string $title, string $active, string $userName, int $pending = 0 ): string { $t = self::h($title); $u = self::h($userName); $groups = [ [ ['dashboard', '/admin/dashboard', 'dashboard', 'Dashboard'], ['live', '/admin/live', 'live', 'Live'], ['chat', '/admin/chat', 'chat', 'Chat'], ], [ ['pending', '/admin/pending', 'pending', 'Pendientes', $pending], ['companies', '/admin/companies', 'companies', 'Empresas'], ], [ ['bot-config', '/admin/bot-config', 'bot-config', 'Bot'], ['conv-flow', '/admin/conversation-flow', 'conv-flow', 'Flujos'], ['settings', '/admin/settings', 'settings', 'Ajustes'], ], ]; $navLinks = ''; foreach ($groups as $gi => $group) { if ($gi > 0) { $navLinks .= ''; } foreach ($group as $item) { [$key, $href, $iconKey, $label] = $item; $badge = isset($item[4]) && $item[4] > 0 ? '' . (int)$item[4] . '' : ''; $cls = $active === $key ? ' active' : ''; $svg = self::icon($iconKey); $navLinks .= "{$svg}{$label}{$badge}"; } } $navLinks .= ''; $navLinks .= '' . self::icon('sync') . ''; $navLinks .= '' . self::icon('send') . ''; $initial = mb_strtoupper(mb_substr($userName, 0, 1, 'UTF-8'), 'UTF-8'); return << {$t} — Palmas360
{$initial}
{$u}
Salir
HTML; } }