feat: add australiums to price table

This commit is contained in:
xenticore
2025-03-28 23:48:29 -04:00
parent f8ca4148f0
commit 279cf4da9d
2 changed files with 26 additions and 2 deletions

View File

@@ -2,13 +2,16 @@ import { ItemPriceData } from "./priceService";
import { formatPrice } from "./utils/formatting";
import { $T } from "./utils/localization";
export function createPriceRow(qualityName: string, data: ItemPriceData, keyPrice: ItemPriceData, locale: string): HTMLTableRowElement {
export function createPriceRow(qualityName: string, data: ItemPriceData, keyPrice: ItemPriceData, locale: string, wikiPage: string = null): HTMLTableRowElement {
const priceRow = document.createElement("tr");
const priceLabel = document.createElement("td");
priceLabel.className = "infobox-label";
const priceLabelLink = document.createElement("a");
priceLabelLink.href = locale === 'en' ? `https://wiki.teamfortress.com/wiki/${qualityName}` : `https://wiki.teamfortress.com/wiki/${qualityName}/${locale}`
if (wikiPage == null) {
wikiPage = `https://wiki.teamfortress.com/wiki/${qualityName}`
}
priceLabelLink.href = locale === 'en' ? wikiPage : `${wikiPage}/${locale}`
priceLabelLink.innerText = $T(qualityName)
priceLabel.appendChild(priceLabelLink);
priceLabel.innerHTML += ':'