Show link url if no title is available

This commit is contained in:
Jon Staab
2025-06-16 11:45:05 -07:00
parent cb0119b9b8
commit d99ada44f5

View File

@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import {ellipsize, postJson} from "@welshman/lib" import {ellipsize, displayUrl, postJson} from "@welshman/lib"
import {dufflepud, imgproxy} from "@app/state" import {dufflepud, imgproxy} from "@app/state"
import {preventDefault, stopPropagation} from "@lib/html" import {preventDefault, stopPropagation} from "@lib/html"
import Link from "@lib/components/Link.svelte" import Link from "@lib/components/Link.svelte"
@@ -54,13 +54,11 @@
src={imgproxy(preview.image)} src={imgproxy(preview.image)}
class="bg-alt max-h-72 object-contain object-center" /> class="bg-alt max-h-72 object-contain object-center" />
{/if} {/if}
{#if preview.title}
<div class="flex flex-col gap-2 p-4"> <div class="flex flex-col gap-2 p-4">
<strong class="overflow-hidden text-ellipsis whitespace-nowrap" <strong class="overflow-hidden text-ellipsis whitespace-nowrap"
>{preview.title}</strong> >{preview.title || displayUrl(url)}</strong>
<p>{ellipsize(preview.description, 140)}</p> <p>{ellipsize(preview.description, 140)}</p>
</div> </div>
{/if}
</div> </div>
{:catch} {:catch}
<p class="bg-alt p-12 text-center leading-normal"> <p class="bg-alt p-12 text-center leading-normal">