A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: e6949ed58f812168cefa30665f7e924913a1a171 (1651 bytes)[doc][blame][raw]
1
import {$lang, http} from '../utils.js';2
import VIcon from '../element/icon.js';3
import VPlayer from '../component/player.js';4
import VTab from '../component/tab.js';5
import VStation from '../component/station.js';7
export default {8
props: ['state'],9
data() {10
return {11
results: [],12
loading: false13
};14
},15
components: {16
VIcon,17
VTab,18
VPlayer,19
VStation20
},21
methods: {22
$lang,23
async doFetch() {24
this.results = [];25
this.loading = true;26
const result = await http`get::/api/like`();27
this.loading = false;28
this.results = result;29
}30
},31
mounted() {32
this.doFetch();33
},34
template: `35
<v-tab id="favorites" :tab="state.tab">36
<v-player :station="state.station"></v-player>37
<ul class="flex flex-col">38
<li39
:key="station.id"40
v-for="station in results"41
class="border-t sm:border-t-2 first:border-none border-zinc-900 py-5 first:pt-0"42
>43
<v-station :station="station"></v-station>44
</li>45
</ul>46
<div47
v-show="loading"48
class="w-[60px] h-[60px] select-none pointer-events-none mx-auto"49
>50
<v-icon51
id="loader"52
class="bg-gray-400 animate-spin"53
style="animation-duration: 2s;"54
size="80%"55
></v-icon>56
</div>57
</v-tab>58
`59
}