import { usePage } from '@inertiajs/react';
import { type AccessScope, type SharedData } from '@/types';

export function useAccessScope(moduleName: string): AccessScope {
    const { auth } = usePage<SharedData>().props;
    return auth?.scope_map?.[moduleName] ?? 'global';
}
