<template>
  <Button
    :href="telegramShareUrl"
    target="_blank"
    size="small"
    severity="secondary"
    as="a"
    class="text-nowrap"
    outlined
    rel="noopener noreferrer"
    icon="pi pi-telegram"
    title="Поделиться ссылкой в Telegram"
    label="Отправить ссылку в Telegram"
  />
</template>

<script setup lang="ts">
import { computed } from 'vue'

const props = defineProps<{ shareUrl: string; shareText: string }>()

const telegramShareUrl = computed(
  () =>
    `https://t.me/share/url?url=${encodeURIComponent(props.shareUrl)}&text=${encodeURIComponent(props.shareText)}`, // &photo=${shareImage}`
)
</script>
