From 2a4789c72aa90ea9a0b8e3c14cc0656eae91d9dd Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 2 Dec 2025 17:19:38 -0800 Subject: [PATCH] add empty state support to DetailsSection --- .../sidebar/details/DetailsSection.svelte | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib/components/sidebar/details/DetailsSection.svelte b/src/lib/components/sidebar/details/DetailsSection.svelte index ae1ec4c5..a07de17d 100644 --- a/src/lib/components/sidebar/details/DetailsSection.svelte +++ b/src/lib/components/sidebar/details/DetailsSection.svelte @@ -4,14 +4,22 @@ interface Props { title: string children: Snippet + /** Message to show when section has no content */ + emptyMessage?: string + /** Whether the section is empty (shows emptyMessage instead of children) */ + empty?: boolean } - let { title, children }: Props = $props() + let { title, children, emptyMessage, empty = false }: Props = $props()

{title}

- {@render children()} + {#if empty && emptyMessage} +

{emptyMessage}

+ {:else} + {@render children()} + {/if}