blob: 8e18e306b32f5be5763d7787a27b44312a5831e1 [file] [log] [blame]
pineafan34369e62022-05-18 16:52:37 +01001import getEmojiByName from "./getEmojiByName.js";
2
3function pageIndicator(amount: number, selected: number, showDetails?: boolean | true) {
4 let out = "";
5
6 if (amount == 1) {
7 out += getEmojiByName("TRACKS.SINGLE." + (selected == 0 ? "ACTIVE" : "INACTIVE"));
8 } else {
9 for (let i = 0; i < amount; i++) {
10 out += getEmojiByName("TRACKS.HORIZONTAL." +
11 (i == 0 ? "LEFT" : (i == amount - 1 ? "RIGHT" : "MIDDLE")) + "." +
12 (i == selected ? "ACTIVE" : "INACTIVE")
13 );
14 }
15 }
16 if (showDetails) {
17 out += " Page " + selected + " of " + amount;
18 }
19 return out;
20}
21
22export default pageIndicator;