<?php

function currentPath(): string
{
    return trim(service('uri')->getPath(), '/');
}

function isActive(string $url): string
{
    return currentPath() === trim($url, '/') ? 'active' : '';
}

// ❌ JANGAN pakai active di parent
function isOpenMenu(string $segment): string
{
    return service('uri')->getSegment(1) === $segment ? 'menu-open' : '';
}
