pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame^] | 1 | import getEmojiByName from "./getEmojiByName.js"; |
| 2 | |
| 3 | function 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 | |
| 22 | export default pageIndicator; |