Skip to content

Commit a09ecf8

Browse files
authored
chore: Remove duplicated conditional rendering in TextElement (#1318)
The text knowledge panel rendered identical markup in both branches of an `ingredients_text` conditional. This change removes the dead conditional path and keeps a single render block.
1 parent 40a8dbe commit a09ecf8

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

src/lib/knowledgepanels/TextElement.svelte

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
66
let { element }: { element: KnowledgeTextElement } = $props();
77
8-
let { type, edit_field_type, html, source_url, source_text, source_language } = $derived(
9-
element.text_element
10-
);
8+
let { type, html, source_url, source_text, source_language } = $derived(element.text_element);
119
</script>
1210

1311
<div class="mb-2 flex items-center space-x-2">
@@ -20,16 +18,9 @@
2018
{/if}
2119
</div>
2220

23-
<!-- Specialization for ingredients_text -->
24-
{#if edit_field_type == 'ingredients_text'}
25-
<div class="prose w-full max-w-full dark:text-white">
26-
<HtmlPurify dirty={html} />
27-
</div>
28-
{:else}
29-
<div class="prose w-full max-w-full dark:text-white">
30-
<HtmlPurify dirty={html} />
31-
</div>
32-
{/if}
21+
<div class="prose w-full max-w-full dark:text-white">
22+
<HtmlPurify dirty={html} />
23+
</div>
3324

3425
{#if source_url}
3526
<a class="link" href={source_url}>

0 commit comments

Comments
 (0)