so://phie

verbal

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

blob: 79a1a4554ad59770eb34b84658d0dfe7109b8a77 (1532 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/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 <li

36 :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 <div

44 v-show="loading"

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

46 >

47 <v-icon

48 id="loader"

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

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

51 size="44px"

52 ></v-icon>

53 </div>

54 </v-tab>

55 `

56}