Skip to content

Commit

Permalink
Fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
RichDom2185 committed Feb 17, 2024
1 parent 8e58125 commit fae2115
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/tabs/common/ButtonComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
import { AnchorButton, Button, type ButtonProps } from '@blueprintjs/core';
import { AnchorButton, Button, Intent } from '@blueprintjs/core';

const ButtonComponent = (props: Omit<ButtonProps, 'elementRef'>) => (props.disabled ? <AnchorButton {...props} /> : <Button {...props} />);
const defaultOptions = {
className: '',
fullWidth: false,
iconOnRight: false,
intent: Intent.NONE,
minimal: true,
};

type Props = {
onClick?: React.MouseEventHandler<HTMLElement>,
disabled?: boolean,
};

const ButtonComponent = (props: Props) => {
const buttonProps = {
...defaultOptions,
...props,
};
return props.disabled
? (
<AnchorButton {...buttonProps} />
)
: (
<Button {...buttonProps} />
);
};
export default ButtonComponent;

0 comments on commit fae2115

Please sign in to comment.