InvokeAI/frontend/src/common/components/IAIButton.tsx

24 lines
530 B
TypeScript
Raw Normal View History

import { Button, ButtonProps, Tooltip } from '@chakra-ui/react';
export interface IAIButtonProps extends ButtonProps {
label: string;
tooltip?: string;
2022-10-30 15:17:24 +00:00
styleClass?: string;
}
/**
* Reusable customized button component.
*/
const IAIButton = (props: IAIButtonProps) => {
2022-10-30 15:17:24 +00:00
const { label, tooltip = '', styleClass, ...rest } = props;
return (
<Tooltip label={tooltip}>
2022-10-30 15:17:24 +00:00
<Button className={styleClass ? styleClass : ''} {...rest}>
{label}
</Button>
</Tooltip>
);
};
export default IAIButton;