mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-13 18:40:06 -04:00
Update src/
This commit is contained in:
parent
09b07e9b24
commit
86743c74f5
132 changed files with 4418 additions and 1907 deletions
24
src/components/ShareChannelButton.svelte
Normal file
24
src/components/ShareChannelButton.svelte
Normal file
|
@ -0,0 +1,24 @@
|
|||
<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>
|
Loading…
Add table
Add a link
Reference in a new issue