so://phie

verbal

A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal

blob: aa79512b54210672b5e52a5b07a6a426a7dadcc6 (1680 bytes)[doc][blame][raw]

1import {$lang, http} from '../utils.js';

2import VIcon from '../element/icon.js';

3import VTab from '../component/tab.js';

4import VStation from '../component/station.js';

5

6export default {

7 props: ['state'],

8 data() {

9 return {

10 results: [],

11 loading: false

12 };

13 },

14 components: {

15 VIcon,

16 VTab,

17 VStation

18 },

19 methods: {

20 $lang,

21 async doFetch() {

22 this.results = [];

23 this.loading = true;

24 const result = await http`get::/api/favorite`();

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 <div class="pb-8 sm:pb-[100px]">

35 <ul class="flex flex-col">

36 <li

37 :key="station.id"

38 v-for="station in results"

39 class="border-t sm:border-t-2 first:border-none border-zinc-900 py-4 first:pt-0"

40 >

41 <v-station :station="station"></v-station>

42 </li>

43 </ul>

44 <div

45 v-show="loading"

46 class="w-[60px] h-[60px] select-none pointer-events-none mx-auto"

47 >

48 <v-icon

49 id="loader"

50 class="text-gray-400 animate-spin"

51 style="animation-duration: 2s;"

52 size="44px"

53 ></v-icon>

54 </div>

55 </div>

56 </v-tab>

57 `

58}