mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-12 01:50:05 -04:00
Update HTMLPreview.svelte
This commit is contained in:
parent
08cc8ab46b
commit
9d6d3073e5
1 changed files with 6 additions and 8 deletions
|
@ -1,17 +1,11 @@
|
||||||
<script>
|
<script>
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { goto } from '$app/navigation'
|
import { goto } from '$app/navigation'
|
||||||
import { query, hasQuery, channels, setSearchParam } from '~/store'
|
import { query, hasQuery, setSearchParam } from '~/store'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
export let close = () => {}
|
export let close = () => {}
|
||||||
|
|
||||||
let replaced_by = null
|
|
||||||
if (data.replaced_by) {
|
|
||||||
const channel = $channels.find(c => c.id === data.replaced_by)
|
|
||||||
if (channel) replaced_by = channel.name
|
|
||||||
}
|
|
||||||
|
|
||||||
const fieldset = [
|
const fieldset = [
|
||||||
{ name: 'logo', type: 'image', value: data.logo },
|
{ name: 'logo', type: 'image', value: data.logo },
|
||||||
{ name: 'id', type: 'string', value: data.id },
|
{ name: 'id', type: 'string', value: data.id },
|
||||||
|
@ -77,7 +71,11 @@
|
||||||
type: 'date',
|
type: 'date',
|
||||||
value: data.closed ? dayjs(data.closed).format('D MMMM YYYY') : null
|
value: data.closed ? dayjs(data.closed).format('D MMMM YYYY') : null
|
||||||
},
|
},
|
||||||
{ name: 'replaced_by', type: 'channel', value: replaced_by },
|
{
|
||||||
|
name: 'replaced_by',
|
||||||
|
type: 'channel',
|
||||||
|
value: data._replaced_by ? data._replaced_by.name : null
|
||||||
|
},
|
||||||
{ name: 'website', type: 'external_link', value: data.website }
|
{ name: 'website', type: 'external_link', value: data.website }
|
||||||
].filter(f => (Array.isArray(f.value) ? f.value.length : f.value))
|
].filter(f => (Array.isArray(f.value) ? f.value.length : f.value))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue