Skip to content

Commit 25755a1

Browse files
committed
Refactor preview props into derived object
1 parent 3d95ec8 commit 25755a1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/lib/components/contents/details/preview/field-preview.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
.filter((val) => val !== undefined)
5555
: valueMap[keyPath],
5656
);
57+
const previewProps = $derived({ locale, keyPath, typedKeyPath, fieldConfig, currentValue });
5758
</script>
5859
5960
{#if fieldType !== 'hidden' && preview && (locale === defaultLocale || canTranslate || canDuplicate)}
@@ -81,7 +82,7 @@
8182
{/if}
8283
{#if fieldType in previews}
8384
{@const Preview = previews[fieldType]}
84-
<Preview {keyPath} {typedKeyPath} {locale} {fieldConfig} {currentValue} />
85+
<Preview {...previewProps} />
8586
{/if}
8687
</section>
8788
{/if}

0 commit comments

Comments
 (0)