| 1 |
<script lang="ts" setup> |
| 2 |
import Card from "@/components/Card.vue"; |
| 3 |
import Button from "@/components/Button/Button.vue"; |
| 4 |
import SkeletonLoader from "@/components/Loaders/SkeletonLoader.vue"; |
| 5 |
import { translate } from "@/utils/helpers"; |
| 6 |
|
| 7 |
type Props = { |
| 8 |
title: string; |
| 9 |
toolImageSrc: string; |
| 10 |
version?: string; |
| 11 |
actionButton?: { |
| 12 |
text: string; |
| 13 |
onClick?: () => void; |
| 14 |
}; |
| 15 |
isLoading?: boolean; |
| 16 |
}; |
| 17 |
|
| 18 |
defineProps<Props>(); |
| 19 |
</script> |
| 20 |
|
| 21 |
<template> |
| 22 |
<Card v-if="isLoading"> |
| 23 |
<template #header> |
| 24 |
<SkeletonLoader width="50%" :height="24" rounded /> |
| 25 |
</template> |
| 26 |
<SkeletonLoader width="100%" :height="24" rounded /> |
| 27 |
</Card> |
| 28 |
<Card v-else class="tool-version-card"> |
| 29 |
<template #header> |
| 30 |
<div class="d-flex justify-content-between w-100"> |
| 31 |
<div class="d-flex"> |
| 32 |
<img |
| 33 |
class="h-mr-8" |
| 34 |
height="24" |
| 35 |
width="24" |
| 36 |
:src="toolImageSrc" |
| 37 |
alt="Tool icon" |
| 38 |
/> |
| 39 |
<div> |
| 40 |
<h3 class="h-m-0"> |
| 41 |
{{ title }} |
| 42 |
</h3> |
| 43 |
<p class="text-body-2">{{ version }}</p> |
| 44 |
</div> |
| 45 |
</div> |
| 46 |
|
| 47 |
</div> |
| 48 |
</template> |
| 49 |
|
| 50 |
<Button |
| 51 |
@click="actionButton?.onClick" |
| 52 |
v-if="actionButton" |
| 53 |
>{{ translate("hostinger_tools_update") }}</Button |
| 54 |
> |
| 55 |
</Card> |
| 56 |
</template> |
| 57 |
|
| 58 |
<style lang="scss" scoped> |
| 59 |
.tool-version-card { |
| 60 |
gap: 0; |
| 61 |
display: flex; |
| 62 |
flex-direction: row; |
| 63 |
|
| 64 |
@media (max-width: 768px) { |
| 65 |
flex-direction: column; |
| 66 |
gap: 16px; |
| 67 |
} |
| 68 |
|
| 69 |
::v-deep(.card__body) { |
| 70 |
flex: 1; |
| 71 |
} |
| 72 |
} |
| 73 |
|
| 74 |
</style> |