mirror of
https://github.com/johndoe6345789/snippet-pastebin.git
synced 2026-04-24 13:34:55 +00:00
refactor: simplify Button component props and styles
Co-authored-by: aider (openrouter/meta-llama/llama-4-maverick) <aider@aider.chat>
This commit is contained in:
@@ -5,22 +5,11 @@ interface ButtonProps {
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
onClick?: () => void;
|
||||
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
||||
size?: 'default' | 'sm' | 'lg' | 'icon';
|
||||
}
|
||||
|
||||
function Button({
|
||||
children,
|
||||
className,
|
||||
onClick,
|
||||
variant = 'default',
|
||||
size = 'default',
|
||||
}: ButtonProps) {
|
||||
function Button({ children, className, onClick }: ButtonProps) {
|
||||
return (
|
||||
<button
|
||||
className={`${styles.button} ${styles[variant]} ${styles[size]} ${className}`}
|
||||
onClick={onClick}
|
||||
>
|
||||
<button className={`${styles.button} ${className}`} onClick={onClick}>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
|
||||
@@ -5,8 +5,8 @@ const shadcnTypes = `
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
onClick?: () => void;
|
||||
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
||||
size?: 'default' | 'sm' | 'lg' | 'icon';
|
||||
variant?: string;
|
||||
size?: string;
|
||||
}
|
||||
export function Button(props: ButtonProps): JSX.Element;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user