From e914337e57a2f135a694cfea959878c79e9a9e38 Mon Sep 17 00:00:00 2001 From: moxi Date: Sun, 4 Jan 2026 01:12:48 +0800 Subject: [PATCH] feat(button): enhance button component to conditionally render children - Added a check to determine if children are present before rendering them in the button. - Improved button rendering logic for better handling of empty or false children values. --- src/components/ui/Button.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ui/Button.tsx b/src/components/ui/Button.tsx index 00d71a9..d4f3dc0 100644 --- a/src/components/ui/Button.tsx +++ b/src/components/ui/Button.tsx @@ -20,6 +20,7 @@ export function Button({ disabled, ...rest }: PropsWithChildren) { + const hasChildren = children !== null && children !== undefined && children !== false; const classes = [ 'btn', `btn-${variant}`, @@ -33,7 +34,7 @@ export function Button({ return ( ); }