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