diff --git a/src/components/TableToolbar/TableToolbarButton.tsx b/src/components/TableToolbar/TableToolbarButton.tsx index 40f4b065..81f7dc64 100644 --- a/src/components/TableToolbar/TableToolbarButton.tsx +++ b/src/components/TableToolbar/TableToolbarButton.tsx @@ -4,27 +4,38 @@ import { Tooltip, Button, ButtonProps } from "@mui/material"; export interface ITableToolbarButtonProps extends Partial { title: string; icon: React.ReactNode; + tooltip?: string; } export const TableToolbarButton = forwardRef(function TableToolbarButton_( - { title, icon, ...props }: ITableToolbarButtonProps, + { title, icon, tooltip, ...props }: ITableToolbarButtonProps, ref: React.Ref ) { + // https://mui.com/material-ui/react-tooltip/#accessibility + const tooltipIsDescription = Boolean(tooltip); + + const button = ( + + ); + return ( - - - - + + {props.disabled ? {button} : button} ); });