« get me outta code hell

generateAlbumTrackListMissingDuration.js « dependencies « content « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateAlbumTrackListMissingDuration.js
blob: 6d4a6ec8976e4cc0ad4d70cd91e84eeb96c1f3a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
export default {
  contentDependencies: ['generateTextWithTooltip', 'generateTooltip'],
  extraDependencies: ['html', 'language'],

  relations: (relation) => ({
    textWithTooltip:
      relation('generateTextWithTooltip'),

    tooltip:
      relation('generateTooltip'),
  }),

  generate: (relations, {html, language}) =>
    relations.textWithTooltip.slots({
      attributes: {class: 'missing-duration'},
      customInteractionCue: true,

      text:
        language.$('trackList.item.withDuration.duration', {
          duration:
            html.tag('span', {class: 'text-with-tooltip-interaction-cue'},
              language.$('trackList.item.withDuration.duration.missing')),
        }),

      tooltip:
        relations.tooltip.slots({
          attributes: {class: 'missing-duration-tooltip'},

          content:
            language.$('trackList.item.withDuration.duration.missing.info'),
        }),
    }),
};