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

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

    return {
        canCreate: can(PERMISSIONS.resourceCreate),
        canCreateGift: can(PERMISSIONS.giftCreate),
        canCreateGrant: can(PERMISSIONS.resourceGrantCreate),
        canCreateGroup: can(PERMISSIONS.resourceGroupCreate),
        canCreateEmojiPack: can(PERMISSIONS.emojiPackCreate),
        canDeleteGift: can(PERMISSIONS.giftDelete),
        canStatusGift: can(PERMISSIONS.giftStatus),
        canUpdateShop: can(PERMISSIONS.resourceShopUpdate),
        canUpdateGroup: can(PERMISSIONS.resourceGroupUpdate),
        canUpdateGift: can(PERMISSIONS.giftUpdate),
        canUpdate: can(PERMISSIONS.resourceUpdate),
        canUpload: can(PERMISSIONS.uploadCreate),
        canView: can(PERMISSIONS.resourceView),
        canViewEmojiPack: can(PERMISSIONS.emojiPackView),
        canViewGrant: can(PERMISSIONS.resourceGrantView),
        canViewShop: can(PERMISSIONS.resourceShopView),
    };
}
