<template>
    <share-sheet
        teleport="#app"
        v-model:show="internalShow"
        :title="t('立即分享给好友')"
        :options="options"
        @select="handleSelect"
    />
</template>

<script setup>
import { useI18n } from "@/i18n";
const { t } = useI18n();
import { ShareSheet } from "vant";
import { computed } from "vue";

const props = defineProps({
    show: {
        type: Boolean,
        default: false,
    },
    options: {
        type: Array,
        default: () => [
            { name: "飞鸟用户", icon: "https://birdseye-img.sysuimars.com/birdseye-look-mini/Group%201321316260.png" ,type: "birdseye"},
            { name: "微信", icon: "wechat", type: "wechat" },
        ],
    },
});

const emit = defineEmits(["update:show", "select"]);

const internalShow = computed({
    get() {
        return props.show;
    },
    set(val) {
        emit("update:show", val);
    },
});

function handleSelect(option) {
    emit("update:show", false);
    emit("select", option);
}
</script>

<style scoped>
</style>


