Skip to content

Commit

Permalink
feat: add isDisabled prop to Button
Browse files Browse the repository at this point in the history
  • Loading branch information
fabryscript committed Feb 9, 2024
1 parent 54d07f5 commit ede41c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/renderer/components/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ interface IButtonProps {
label?: string;
onClick?: () => void;
className?: string;
isDisabled?: boolean;
}

export default function Button({
Expand All @@ -15,6 +16,7 @@ export default function Button({
label,
className,
children,
isDisabled,
}: PropsWithChildren<IButtonProps>) {
return (
<button
Expand All @@ -28,9 +30,11 @@ export default function Button({
variant === 'secondary',
'hover:bg-neutral-700 transition-colors text-neutral-200':
variant === 'ghost',
'opacity-70 hover:cursor-not-allowed': isDisabled,
},
className,
)}
disabled={isDisabled}
onClick={onClick}
>
{label || children}
Expand Down

0 comments on commit ede41c7

Please sign in to comment.