cleans up children snippet

This commit is contained in:
MinamiFunakoshiTR 2025-03-18 13:51:23 -07:00
parent 72d26e2573
commit ad707fdfe0
Failed to extract signature
2 changed files with 7 additions and 6 deletions

View file

@ -6,16 +6,17 @@
* Whether to wrap the graphic with an aria hidden tag.
*/
hidden?: boolean;
/** Content to put inside `AriaHidden`*/
children: Snippet;
}
let { hidden = false, children }: Props = $props();
</script>
{#if hidden && children}
{#if hidden}
<div aria-hidden="true">
{@render children()}
</div>
{:else if children}
{:else}
{@render children()}
{/if}

View file

@ -6,17 +6,17 @@
interface Props {
/** Width of the component within the text well. */
width?: ContainerWidth;
// children?: import('svelte').Snippet;
children?: Snippet;
/** Content to put inside `TextBlock`*/
children: Snippet;
}
let { width, children }: Props = $props();
</script>
{#if width && children}
{#if width}
<Block {width} class="notes fmy-0">
{@render children()}
</Block>
{:else if children}
{:else}
{@render children()}
{/if}