import { useAuth } from "@/app/auth/AuthProvider.jsx";
import { PERMISSIONS } from "@/app/permissions";

export function useAppConfigAbilities() {
    const { can } = useAuth();

    return {
        canCreateVersion: can(PERMISSIONS.appVersionCreate),
        canDeleteVersion: can(PERMISSIONS.appVersionDelete),
        canUpdate: can(PERMISSIONS.appConfigUpdate),
        canUpdateVersion: can(PERMISSIONS.appVersionUpdate),
        canUpload: can(PERMISSIONS.uploadCreate),
        canView: can(PERMISSIONS.appConfigView),
        canViewVersion: can(PERMISSIONS.appVersionView),
    };
}

export function useSystemMessagePushAbilities() {
    const { can } = useAuth();

    return {
        canSend: can(PERMISSIONS.fullServerNoticeSend),
        canView: can(PERMISSIONS.fullServerNoticeView),
    };
}
