fix(SwitchButtonGroup): remove redundant containerPadding conditional

Both branches of the ternary returned 'p-1'. Inline the constant
directly into the className string.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
雨霖铃
2026-05-27 13:53:11 +08:00
parent 2e2f6e9835
commit 8b58dcf02e
+1 -5
View File
@@ -34,14 +34,10 @@ export default function SwitchButtonGroup<T extends string | number = string>({
large: 'text-base h-11 px-4 py-2 rounded-lg', large: 'text-base h-11 px-4 py-2 rounded-lg',
}; };
const containerPadding = size === 'large' ? 'p-1' : 'p-1';
return ( return (
<div <div
className={cn( className={cn(
// 将默认布局设计得更为通用(去掉一刀切的 mb-4,由外部控制布局空间) 'inline-flex w-full items-center justify-center rounded-lg bg-muted text-muted-foreground p-1',
'inline-flex w-full items-center justify-center rounded-lg bg-muted text-muted-foreground',
containerPadding,
className, className,
)} )}
{...props} {...props}