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