Message if no titles

This commit is contained in:
CakesTwix 2024-09-26 11:39:53 +03:00
parent 660426cd53
commit a396859616
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825

View file

@ -32,7 +32,22 @@
<TitleCard v-for="title in titles" :key="title.codename" :title="title" @update-title="updateByCodename" @delete-title="deleteByCodename" /> <TitleCard v-for="title in titles" :key="title.codename" :title="title" @update-title="updateByCodename" @delete-title="deleteByCodename" />
</main> </main>
<main class="responsive middle-align center-align" v-else> <main class="responsive middle-align center-align" v-if="isEmpty">
<div class="padding absolute center middle">
<article class="medium middle-align center-align">
<div>
<i class="extra">sentiment_sad</i>
<h5 class="primary-text">Тайтлів нема :(</h5>
<p class="secondary-text">Щоб додати, перейдіть до <i>add</i> Додати</p>
<div class="space"></div>
<nav class="center-align">
<RouterLink to="/add"><i class="chip circle">add</i></RouterLink>
</nav>
</div>
</article>
</div>
</main>
<main class="responsive middle-align center-align" v-if="titles.length == 0 && !isEmpty">
<progress class="circle extra"></progress> <progress class="circle extra"></progress>
</main> </main>
@ -62,7 +77,8 @@ export default {
titles: [], // Titles list titles: [], // Titles list
search: '', // Search bar search: '', // Search bar
update: {}, // Update stuff, notif update: {}, // Update stuff, notif
isUpdated: false // Update notif isUpdated: false, // Update notif
isEmpty: false,
}; };
}, },
created() { created() {
@ -73,6 +89,10 @@ export default {
async fetchTorrents() { async fetchTorrents() {
void await axios.get(`/api/titles`).then(response => { void await axios.get(`/api/titles`).then(response => {
this.titles = response.data this.titles = response.data
if (this.titles.length == 0){
this.isEmpty = true
}
}) })
}, },
filterTitles() { filterTitles() {