blob: fa203dc66d1a31e829ae5584071f2f5a266d32a0 [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
pineafane23c4ec2022-07-27 21:56:27 +01006 if (amount === 1) {
7 out += getEmojiByName("TRACKS.SINGLE." + (selected === 0 ? "ACTIVE" : "INACTIVE"));
pineafan34369e62022-05-18 16:52:37 +01008 } else {
9 for (let i = 0; i < amount; i++) {
10 out += getEmojiByName("TRACKS.HORIZONTAL." +
pineafane23c4ec2022-07-27 21:56:27 +010011 (i === 0 ? "LEFT" : (i === amount - 1 ? "RIGHT" : "MIDDLE")) + "." +
12 (i === selected ? "ACTIVE" : "INACTIVE")
pineafan34369e62022-05-18 16:52:37 +010013 );
14 }
15 }
16 if (showDetails) {
17 out += " Page " + selected + " of " + amount;
18 }
19 return out;
20}
21
22export default pageIndicator;