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),
        canGrantVip: can(PERMISSIONS.vipConfigGrant),
        canRevokeGrant: can(PERMISSIONS.resourceGrantRevoke),
        canCreateEmojiPack: can(PERMISSIONS.emojiPackCreate),
        canDelete: can(PERMISSIONS.resourceDelete),
        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),
        canViewGroup: can(PERMISSIONS.resourceGroupView),
        canViewShop: can(PERMISSIONS.resourceShopView),
    };
}
