blob: 4ddbae2b3e388947208b16cb39d526cc83de870c [file] [log] [blame]
pineafan34369e62022-05-18 16:52:37 +01001import getEmojiByName from "./getEmojiByName.js";
2
TheCodedProfc2acbcc2023-01-20 17:23:51 -05003function pageIndicator(amount: number, selected: number, showDetails?: boolean, disabled?: boolean | string) {
pineafan34369e62022-05-18 16:52:37 +01004 let out = "";
TheCodedProfc2acbcc2023-01-20 17:23:51 -05005 disabled = disabled ? "GREY." : ""
pineafane23c4ec2022-07-27 21:56:27 +01006 if (amount === 1) {
TheCodedProfc2acbcc2023-01-20 17:23:51 -05007 out += getEmojiByName("TRACKS.SINGLE." + (disabled) + (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." +
TheCodedProfc2acbcc2023-01-20 17:23:51 -050012 (i === 0 ? "LEFT" : i === amount - 1 ? "RIGHT" : "MIDDLE") +
13 "." + (disabled) +
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;