fix(ui): make Button.children optional in props type
svelte-check (strict) flagged ContactFormComponent for not passing children to <Button>. The component already renders label as fallback; typed children as optional Snippet so callers don't need to pass it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
type Variant = 'primary' | 'secondary' | 'ghost';
|
||||
type Size = 'sm' | 'md' | 'large';
|
||||
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
let {
|
||||
variant = 'primary',
|
||||
size = 'md',
|
||||
@@ -9,7 +11,15 @@
|
||||
loading = false,
|
||||
type = 'button' as 'button' | 'submit' | 'reset',
|
||||
label = '',
|
||||
children,
|
||||
children = undefined,
|
||||
}: {
|
||||
variant?: 'primary' | 'secondary' | 'ghost';
|
||||
size?: 'sm' | 'md' | 'large';
|
||||
disabled?: boolean;
|
||||
loading?: boolean;
|
||||
type?: 'button' | 'submit' | 'reset';
|
||||
label?: string;
|
||||
children?: Snippet;
|
||||
} = $props();
|
||||
|
||||
const base =
|
||||
|
||||
Reference in New Issue
Block a user