2022-12-07 16:55:45 +01:00
|
|
|
<script setup lang="ts">
|
2023-01-08 07:21:09 +01:00
|
|
|
import type { mastodon } from 'masto'
|
2022-12-07 16:55:45 +01:00
|
|
|
|
2022-12-09 22:13:59 +01:00
|
|
|
const props = defineProps<{
|
2023-01-08 07:21:09 +01:00
|
|
|
card: mastodon.v1.PreviewCard
|
2022-12-09 22:13:59 +01:00
|
|
|
/** For the preview image, only the small image mode is displayed */
|
|
|
|
smallPictureOnly?: boolean
|
|
|
|
/** When it is root card in the list, not appear as a child card */
|
|
|
|
root?: boolean
|
2022-12-07 16:55:45 +01:00
|
|
|
}>()
|
2022-12-13 19:30:40 +01:00
|
|
|
|
2022-12-11 11:52:36 +01:00
|
|
|
const providerName = $computed(() => props.card.providerName ? props.card.providerName : new URL(props.card.url).hostname)
|
2022-12-07 16:55:45 +01:00
|
|
|
|
2023-01-15 15:19:22 +01:00
|
|
|
const gitHubCards = $(usePreferences('experimentalGitHubCards'))
|
2022-12-07 16:55:45 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-01-17 10:59:16 +01:00
|
|
|
<LazyStatusPreviewGitHub v-if="gitHubCards && providerName === 'GitHub'" :card="card" />
|
|
|
|
<LazyStatusPreviewStackBlitz v-else-if="gitHubCards && providerName === 'stackblitz.com'" :card="card" :small-picture-only="smallPictureOnly" :root="root" />
|
|
|
|
<StatusPreviewCardNormal v-else :card="card" :small-picture-only="smallPictureOnly" :root="root" />
|
2022-12-07 16:55:45 +01:00
|
|
|
</template>
|