mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-11 17:40:05 -04:00
24 lines
541 B
Svelte
24 lines
541 B
Svelte
<script lang="ts">
|
|
import IconButton from '~/components/IconButton.svelte'
|
|
import type { Channel } from '~/models'
|
|
import * as Icon from '~/icons'
|
|
|
|
export let channel: Channel
|
|
|
|
async function onClick() {
|
|
if (navigator.canShare) {
|
|
try {
|
|
navigator.share({
|
|
title: channel.getUniqueName(),
|
|
url: channel.getPageUrl()
|
|
})
|
|
} catch (err) {
|
|
console.log(err.message)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<IconButton {onClick}>
|
|
<Icon.Share class="text-gray-400" size={18} />
|
|
</IconButton>
|