2023-07-04 20:53:02 -04:00
|
|
|
<!--
|
|
|
|
This component is used for the video tab under a user
|
|
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
2023-07-20 13:57:01 -04:00
|
|
|
<div class="bg-ctp-mantle mt-1 p-5 pt-3 rounded-lg w-full space-y-3">
|
|
|
|
<div class="inline-flex w-full">
|
2023-08-18 13:39:26 -04:00
|
|
|
<span class="pr-3 font-bold text-3xl">{{ $t('streamer.videos') }}</span>
|
2023-07-20 13:57:01 -04:00
|
|
|
</div>
|
2023-07-04 20:53:02 -04:00
|
|
|
|
2023-08-18 13:39:26 -04:00
|
|
|
<h1 v-if="!shelves && status === 'error'">{{ $t('streamer.videoerror') }}</h1>
|
2023-07-20 13:57:01 -04:00
|
|
|
|
|
|
|
<div v-else-if="shelves" class="mb-5">
|
|
|
|
<div class="space-y-5">
|
|
|
|
<div v-for="shelve of shelves" :key="shelve.title">
|
|
|
|
<h1 class="font-bold text-lg">{{ shelve.title }}</h1>
|
|
|
|
|
|
|
|
<div
|
|
|
|
class="whitespace-nowrap overflow-x-auto overflow-y-hidden w-full inline-flex space-x-5"
|
|
|
|
>
|
|
|
|
<video-preview
|
|
|
|
v-for="video of shelve.videos"
|
|
|
|
:key="video.title"
|
|
|
|
:data="video"
|
|
|
|
></video-preview>
|
|
|
|
</div>
|
2023-07-04 20:53:02 -04:00
|
|
|
</div>
|
2023-07-20 13:57:01 -04:00
|
|
|
<hr />
|
|
|
|
</div>
|
2023-07-04 20:53:02 -04:00
|
|
|
</div>
|
2023-07-20 13:57:01 -04:00
|
|
|
</div>
|
2023-07-04 20:53:02 -04:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
import { getEndpoint } from '@/mixins'
|
|
|
|
import type { Shelve } from '@/types/VOD'
|
|
|
|
import VideoPreview from '@/components/user/VideoPreview.vue'
|
|
|
|
|
|
|
|
export default {
|
2023-07-20 13:57:01 -04:00
|
|
|
setup() {
|
|
|
|
return {
|
|
|
|
shelves: ref<Shelve[]>([]),
|
|
|
|
status: ''
|
2023-07-04 20:53:02 -04:00
|
|
|
}
|
2023-07-20 13:57:01 -04:00
|
|
|
},
|
|
|
|
async mounted() {
|
|
|
|
const username = this.$route.params.username
|
|
|
|
|
|
|
|
await getEndpoint('api/vods/shelve/' + username)
|
|
|
|
.then((data) => {
|
|
|
|
this.shelves = data
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
this.status = 'error'
|
|
|
|
})
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
VideoPreview
|
|
|
|
}
|
2023-07-04 20:53:02 -04:00
|
|
|
}
|
2023-07-20 13:57:01 -04:00
|
|
|
</script>
|