import { computed } from 'vue' import { ReplayGainMode } from '../types' export const Icon = ({ icon, mode = ReplayGainMode.None }: { icon: string, mode?: ReplayGainMode }) => { const svg = computed(() => { if (icon !== 'replaygain') { return ( (Array.isArray(icons[icon])) ? { viewBox: `0 0 ${icons[icon][0]} ${icons[icon][0]}`, data: icons[icon][1] } : { viewBox: '0 0 24 24', data: icons[icon] } ) } else { const firstChar = ( (mode === ReplayGainMode.None) ? 'RG' : 'R' ), secondChar = ( (mode === ReplayGainMode.Album) ? 'A' : ( (mode === ReplayGainMode.Track) ? 'T' : null ) ) return { viewBox: '0 0 24 24', data: ` ${firstChar} ${secondChar !== null ? `${secondChar}` : ''} ` } } }) return vine` ` } const icons = { add: ``, albums: ``, artists: ``, cache: ``, cached: ``, discover: ``, download: ``, edit: ``, genres: ``, globe: ``, back: ``, chart: ``, heart: ``, 'heart-fill': ``, 'heart-artist': ``, info: ``, link: ``, logout: ``, lastfm: [32,``], 'note-plus': ``, pause: ``, play: ``, playlist: ``, 'playlist-add': ``, 'playlist-remove': ``, plus: ``, radio: ``, random: ``, recent: ``, refresh: ``, repeat: ``, shuffle: ``, 'skip': ``, 'skip-end': [256,``], sort: ``, stack: ``, musicbrainz: ``, 'more': ``, tracks: ``, trash: ``, volume: ``, 'volume-low': ``, mute: ``, queue: ``, waveform: ` `, }