Files
cloudron-box/dashboard/src/components/PreviewPanel.vue

50 lines
785 B
Vue
Raw Normal View History

2023-02-22 19:31:12 +01:00
<template>
<div class="preview-panel">
2023-05-15 09:26:37 +02:00
<img :src="item.previewUrl || item.icon" :alt="item.name" :class="{'shadow': item.previewUrl }" @error="iconError($event)"/>
2023-02-23 13:16:21 +01:00
<p>{{ item.name }}</p>
2023-02-22 19:31:12 +01:00
</div>
</template>
<script>
export default {
name: 'PreviewPanel',
props: {
2023-05-15 09:26:37 +02:00
item: Object,
fallbackIcon: String
},
methods: {
iconError(event) {
event.target.src = this.fallbackIcon;
}
2023-02-22 19:31:12 +01:00
}
};
</script>
<style scoped>
.preview-panel {
padding: 0 30px;
2023-02-23 13:16:21 +01:00
display: flex;
flex-direction: column;
}
.preview-panel > img {
min-width: 90%;
2023-02-23 13:16:21 +01:00
max-width: 256px;
margin: auto;
}
.shadow {
box-shadow: 0 2px 5px rgba(0,0,0,.2);
2023-02-23 13:16:21 +01:00
}
.preview-panel > p {
text-align: center;
font-size: 24px;
overflow: hidden;
text-overflow: ellipsis;
2023-02-22 19:31:12 +01:00
}
</style>