5180 fichiers 38.5 Mo 0 téléchargements 224 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / api / inventory / TradeOfferSummary.ts
TradeOfferSummary.ts 983 o Télécharger le fichier
import { localizeWithFallback } from '../utils/localizeWithFallback';

interface ITradeOfferTotals {
    itemCount: number;
    creditsCount: number;
}

/** AIR TradingView.showOfferInfo: the two lines under one side of the trade. */
export const getTradeOfferSummary = (user: ITradeOfferTotals): { items: string; credits: string } => {
    const items = String(user?.itemCount ?? 0);
    const credits = String(user?.creditsCount ?? 0);

    return {
        items: localizeWithFallback('inventory.trading.info.itemcount', `${ items } items`, ['value'], [items]),
        credits: localizeWithFallback('inventory.trading.info.creditvalue', `${ credits } credits`, ['value'], [credits])
    };
};

/** AIR TradingModel: the credit furni warning shows as soon as either side offers credit furni. */
export const isTradeOfferingCredits = (ownUser: ITradeOfferTotals, otherUser: ITradeOfferTotals): boolean =>
    (ownUser?.creditsCount ?? 0) > 0 || (otherUser?.creditsCount ?? 0) > 0;
15Sujets
1Dépôts
20Membres
2En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser