blob: ee123d64d90daba9e18d0d8a7ffb00b0cb1cc7ed [file] [log] [blame]
pineafan34369e62022-05-18 16:52:37 +01001import getEmojiByName from "./getEmojiByName.js";
2
Skyler Grey11236ba2022-08-08 21:13:33 +01003function pageIndicator(amount: number, selected: number, showDetails?: boolean | true) {
pineafan34369e62022-05-18 16:52:37 +01004 let out = "";
5
pineafane23c4ec2022-07-27 21:56:27 +01006 if (amount === 1) {
Skyler Grey11236ba2022-08-08 21:13:33 +01007 out += getEmojiByName("TRACKS.SINGLE." + (selected === 0 ? "ACTIVE" : "INACTIVE"));
pineafan34369e62022-05-18 16:52:37 +01008 } else {
9 for (let i = 0; i < amount; i++) {
Skyler Grey75ea9172022-08-06 10:22:23 +010010 out += getEmojiByName(
11 "TRACKS.HORIZONTAL." +
12 (i === 0 ? "LEFT" : i === amount - 1 ? "RIGHT" : "MIDDLE") +
13 "." +
14 (i === selected ? "ACTIVE" : "INACTIVE")
pineafan34369e62022-05-18 16:52:37 +010015 );
16 }
17 }
18 if (showDetails) {
19 out += " Page " + selected + " of " + amount;
20 }
21 return out;
22}
23
Skyler Grey75ea9172022-08-06 10:22:23 +010024export default pageIndicator;