A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: d7a13931db691dd41ef192a8e7f11fbfa1d54825 (2637 bytes)[doc][blame][raw]
1
import {state} from '../main.js';2
import {$lang, http} 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
},20
template: `21
<div>22
<div v-if="type === undefined || type === 'list'" class="w-full gap-4 group flex items-center">23
<v-image24
:station="station"25
@click="() => state.app.$refs.player.play(station)"26
class="w-[54px] h-[54px] min-w-[54px] cursor-pointer"27
></v-image>28
<div29
class="flex flex-col flex-1 min-w-0 cursor-pointer"30
@click="() => state.app.$refs.detail.show(station)"31
>32
<p33
:title="station.name"34
class="text-lg font-medium text-gray-100 pb-0 overflow-hidden text-ellipsis whitespace-nowrap"35
>36
{{station.name}}37
</p>38
<span class="text-md text-gray-400 overflow-hidden flex gap-2 sm:gap-3">39
<span40
v-if="station.country"41
class="text-gray-400 inline-flex items-center gap-[5px]"42
:title="$lang('global.country')"43
>44
<v-icon45
id="map-pin"46
class="w-[18px] h-[18px] !min-w-[18px] inline-flex text-gray-400"47
size="100%"48
></v-icon>49
<p>{{station.state ? station.state + ', ' : ''}}{{station.country}}</p>50
</span>51
</span>52
</div>53
</div>54
<div v-if="type === 'grid'" class="flex flex-col gap-3 group w-full min-w-full">55
<v-image56
:station="station"57
@click="() => state.app.$refs.detail.show(station)"58
class="w-full aspect-square min-w-full cursor-pointer"59
></v-image>60
<p61
:title="station.name"62
class="text-md font-medium text-gray-100 pb-0 w-full"63
>64
{{station.name}}65
</p>66
</div>67
</div>68
`69
}