72 lines
1.6 KiB
Vue
72 lines
1.6 KiB
Vue
<script setup lang="ts">
|
|
import { proxyImage } from '@/lib/proxyImage';
|
|
import type { ThreadMessage } from '@/types/dredge.types';
|
|
|
|
defineProps<{
|
|
message: ThreadMessage;
|
|
}>();
|
|
</script>
|
|
|
|
<template>
|
|
<a
|
|
:href="message.shared_url ?? undefined"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="message-share"
|
|
>
|
|
<img
|
|
v-if="message.shared_preview_image"
|
|
:src="proxyImage(message.shared_preview_image)"
|
|
alt=""
|
|
class="message-share__image"
|
|
/>
|
|
<span class="message-share__body">
|
|
<span v-if="message.shared_title" class="message-share__title">
|
|
{{ message.shared_title }}
|
|
</span>
|
|
<span v-if="message.shared_caption" class="message-share__caption">
|
|
{{ message.shared_caption }}
|
|
</span>
|
|
</span>
|
|
</a>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.message-share {
|
|
display: flex;
|
|
gap: 0.6rem;
|
|
text-decoration: none;
|
|
color: inherit;
|
|
background: rgba(0, 0, 0, 0.15);
|
|
border-radius: 8px;
|
|
padding: 0.4rem;
|
|
}
|
|
.message-share__image {
|
|
width: 48px;
|
|
height: 48px;
|
|
object-fit: cover;
|
|
border-radius: 6px;
|
|
flex-shrink: 0;
|
|
}
|
|
.message-share__body {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-width: 0;
|
|
justify-content: center;
|
|
}
|
|
.message-share__title {
|
|
font-weight: 600;
|
|
font-size: 0.82rem;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
.message-share__caption {
|
|
font-size: 0.75rem;
|
|
opacity: 0.8;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
</style>
|