<?php
if (!defined('ROOT_PATH')) exit;
try {
    if (!class_exists('Core\\System\\PluginManager')) return;
    if (!\Core\System\PluginManager::isActive('facebook-ads')) return;
    $fbKey = db()->query("SELECT license_key FROM fb_settings LIMIT 1")->fetchColumn();
    if (!$fbKey) return;
} catch (\Throwable $e) {
    return;
}
$_fbUri = $_SERVER['REQUEST_URI'] ?? '/';
$_fbAct = str_contains($_fbUri, '/admin/facebook-ads') ? 'active' : '';
?>
<li class="nav-item">
    <a href="/admin/facebook-ads" class="nav-link <?= $_fbAct ?>">
        <i class="nav-icon bi bi-facebook" style="color:#1877f2"></i>
        <p><?= __('fb_ads.sidebar_label', 'Facebook Ads') ?></p>
    </a>
</li>
