A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: df1bc1f9668c6370accf3e5561a519b83e8fd483 (2634 bytes)[doc][blame][raw]
1
import {state} from '../main.js';2
import {$lang, $route} from '../utils.js';3
import VButton from '../element/button.js';4
import VIcon from '../element/icon.js';5
import VImage from '../element/image.js';7
export default {8
props: ['station', 'type'],9
data() {10
return { state };11
},12
components: {13
VButton,14
VIcon,15
VImage16
},17
methods: {18
$lang,19
$route20
},21
template: `22
<div>23
<div v-if="type === undefined || type === 'list'" class="w-full gap-4 group flex items-center">24
<v-image25
:station="station"26
@click="() => state.app.$refs.player.play(station)"27
class="w-[54px] h-[54px] min-w-[54px] cursor-pointer"28
></v-image>29
<div30
class="flex flex-col flex-1 min-w-0 cursor-pointer"31
@click="$route('/station/' + station.id)"32
>33
<p34
:title="station.name"35
class="text-lg font-medium text-gray-100 pb-0 overflow-hidden text-ellipsis whitespace-nowrap"36
>37
{{station.name}}38
</p>39
<span class="text-md text-gray-400 overflow-hidden flex gap-2 sm:gap-3">40
<span41
v-if="station.country"42
class="text-gray-400 inline-flex items-center gap-[5px]"43
:title="$lang('global.country')"44
>45
<v-icon46
id="map-pin"47
class="w-[18px] h-[18px] !min-w-[18px] inline-flex text-gray-400"48
size="100%"49
></v-icon>50
<p>{{station.state ? station.state + ', ' : ''}}{{station.country}}</p>51
</span>52
</span>53
</div>54
</div>55
<div v-if="type === 'grid'" class="flex flex-col gap-3 group w-full min-w-full">56
<v-image57
:station="station"58
@click="$route('/station/' + station.id)"59
class="w-full aspect-square min-w-full cursor-pointer"60
></v-image>61
<p62
:title="station.name"63
class="text-md font-medium text-gray-100 pb-0 w-full"64
>65
{{station.name}}66
</p>67
</div>68
</div>69
`70
}