14 function lineItem(display: string, value: number): string {
18 <span class="text">${value.toLocaleString()}</span>
23 export function renderCost(cost: Cost): string {
24 const costAsArray = [];
26 costAsArray.push(lineItem('Credits', cost.credits));
27 costAsArray.push(lineItem('Time', cost.time));
30 costAsArray.push(lineItem('Alloys', cost.alloys));
33 costAsArray.push(lineItem('Food', cost.food));
36 costAsArray.push(lineItem('Energy', cost.energy));
39 costAsArray.push(lineItem('Space', cost.land));
42 costAsArray.push(lineItem('Pop', cost.population));
45 costAsArray.push(lineItem('Soldiers', cost.soldiers));
48 costAsArray.push(lineItem('Attackers', cost.attackers));
51 costAsArray.push(lineItem('Defenders', cost.defenders));
55 return `<div class="cost-display">${costAsArray.join("")}</div>`;