mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:53:44 +08:00
25 lines
611 B
TypeScript
25 lines
611 B
TypeScript
import {
|
|
Tooltip,
|
|
IconButton,
|
|
IconButtonProps,
|
|
SvgIconProps,
|
|
} from "@mui/material";
|
|
import { InfoRounded } from "@mui/icons-material";
|
|
|
|
interface Props extends IconButtonProps {
|
|
title?: string;
|
|
icon?: React.ElementType<SvgIconProps>;
|
|
}
|
|
|
|
export const TooltipIcon: React.FC<Props> = (props: Props) => {
|
|
const { title = "", icon: Icon = InfoRounded } = props;
|
|
|
|
return (
|
|
<Tooltip title={title} placement="top">
|
|
<IconButton color="inherit" size="small" {...props}>
|
|
<Icon fontSize="inherit" style={{ cursor: "pointer", opacity: 0.75 }} />
|
|
</IconButton>
|
|
</Tooltip>
|
|
);
|
|
};
|