Skip to content

Commit d321f2f

Browse files
committed
chore: updating packages and reusing code
1 parent 43e906c commit d321f2f

File tree

5 files changed

+163
-147
lines changed

5 files changed

+163
-147
lines changed

components/News.vue

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,23 @@ const isPending = status.value === "pending";
1313
</script>
1414

1515
<template>
16-
<article class="card bg-white shadow-lg">
17-
<div class="card-body">
18-
<h2 class="card-title">ATM informa</h2>
19-
<ul class="list-none">
20-
<li
21-
v-for="(item, index) in data"
22-
:key="index"
23-
:class="isPending ? 'my-2 animate-pulse' : 'my-2 align-middle'"
16+
<Card title="ATM informa">
17+
<ul class="list-none">
18+
<li
19+
v-for="(item, index) in data"
20+
:key="index"
21+
:class="isPending ? 'my-2 animate-pulse' : 'my-2 align-middle'"
22+
>
23+
<div v-if="isPending" :class="loadingClass()"></div>
24+
<a
25+
v-else
26+
:href="item.url"
27+
target="_blank"
28+
rel="nofollow noopener"
29+
class="hover:underline hover:text-primary"
30+
><Icon name="ri:external-link-fill" /> {{ item.text }}</a
2431
>
25-
<div v-if="isPending" :class="loadingClass()"></div>
26-
<a
27-
v-else
28-
:href="item.url"
29-
target="_blank"
30-
rel="nofollow noopener"
31-
class="hover:underline hover:text-primary"
32-
><Icon name="ri:external-link-fill" /> {{ item.text }}</a
33-
>
34-
</li>
35-
</ul>
36-
</div>
37-
</article>
32+
</li>
33+
</ul>
34+
</Card>
3835
</template>

components/Status.vue

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,22 @@ if (error.value) console.error("ERROR from useFetch: ", error.value);
1919
</script>
2020

2121
<template>
22-
<article class="card bg-white shadow-lg">
23-
<div class="card-body">
24-
<h2 class="card-title">Status linee MM</h2>
25-
<ul>
26-
<li
27-
v-for="(item, index) in data"
28-
:key="index"
29-
:class="isPending ? 'my-2 animate-pulse' : 'my-2'"
22+
<Card title="Status linee MM">
23+
<ul>
24+
<li
25+
v-for="(item, index) in data"
26+
:key="index"
27+
:class="isPending ? 'my-2 animate-pulse' : 'my-2'"
28+
>
29+
<div :class="isPending ? loadingClass() : lineClass(item.line)">
30+
<span v-if="!isPending" class="text-base-100">{{ item.line }}</span>
31+
</div>
32+
{{ " " }}
33+
<!-- <span v-if="!isPending">{{ item.text }} |{{ " " }} {{ item.status }}{{ " " }}</span> -->
34+
<span v-if="!isPending" :class="notActive(item.status)"
35+
>{{ " " }} {{ item.status }}</span
3036
>
31-
<div :class="isPending ? loadingClass() : lineClass(item.line)">
32-
<span v-if="!isPending" class="text-base-100">{{ item.line }}</span>
33-
</div>
34-
{{ " " }}
35-
<!-- <span v-if="!isPending">{{ item.text }} |{{ " " }} {{ item.status }}{{ " " }}</span> -->
36-
<span v-if="!isPending" :class="notActive(item.status)"
37-
>{{ " " }} {{ item.status }}</span
38-
>
39-
</li>
40-
</ul>
41-
</div>
42-
</article>
37+
</li>
38+
</ul>
39+
</Card>
4340
</template>

components/Traffic.vue

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,23 @@ if (error.value) console.log("ERROR from useFetch: ", error.value);
1111
</script>
1212

1313
<template>
14-
<article class="card bg-white shadow-lg">
15-
<div class="card-body">
16-
<h2 class="card-title">Cambiamenti</h2>
17-
<ul>
18-
<li
19-
v-for="(item, index) in data"
20-
:key="index"
21-
:class="isPending ? 'my-2 animate-pulse' : 'my-2 align-middle'"
14+
<Card title="Cambiamenti">
15+
<ul>
16+
<li
17+
v-for="(item, index) in data"
18+
:key="index"
19+
:class="isPending ? 'my-2 animate-pulse' : 'my-2 align-middle'"
20+
>
21+
<div v-if="isPending" :class="loadingClass()"></div>
22+
<a
23+
v-else
24+
:href="item.url"
25+
target="_blank"
26+
rel="nofollow noopener"
27+
class="hover:underline hover:text-primary"
28+
><Icon name="ri:external-link-fill" /> {{ item.text }}</a
2229
>
23-
<div v-if="isPending" :class="loadingClass()"></div>
24-
<a
25-
v-else
26-
:href="item.url"
27-
target="_blank"
28-
rel="nofollow noopener"
29-
class="hover:underline hover:text-primary"
30-
><Icon name="ri:external-link-fill" /> {{ item.text }}</a
31-
>
32-
</li>
33-
</ul>
34-
</div>
35-
</article>
30+
</li>
31+
</ul>
32+
</Card>
3633
</template>

0 commit comments

Comments
 (0)