Update BlockedBadge.svelte

This commit is contained in:
freearhey 2025-03-06 19:31:55 +03:00
parent cff58b10b1
commit 618f9c6dd0

View file

@ -3,12 +3,20 @@
export let channel
let reason
const messages = {
dmca: 'The channel has been added to our blocklist due to the claims of the copyright holder',
nsfw: 'The channel has been added to our blocklist due to NSFW content'
}
const blocklistRefs = channel.blocklist_records
.map(record => {
const parts = record.ref.split('/')
const issueId = parts.pop()
const prefix = record.ref.includes('/issues/') ? '#' : ''
reason = record.reason
return `<a class="underline" target="_blank" rel="noreferrer" href="${record.ref}">${prefix}${issueId}</a>`
})
.join(', ')
@ -17,7 +25,7 @@
<div
class="text-gray-500 border-[1px] border-gray-200 text-xs inline-flex items-center px-2.5 py-0.5 dark:text-gray-300 rounded-full"
use:tippy={{
content: `The channel has been added to our blocklist due to the claims of the copyright holder: ${blocklistRefs}`,
content: `${messages[reason]}: ${blocklistRefs}`,
allowHTML: true,
placement: 'right',
interactive: true