|
|
@ -3,20 +3,29 @@ import {
|
|
|
|
FontAwesomeIcon,
|
|
|
|
FontAwesomeIcon,
|
|
|
|
FontAwesomeIconProps,
|
|
|
|
FontAwesomeIconProps,
|
|
|
|
} from "@fortawesome/react-fontawesome";
|
|
|
|
} from "@fortawesome/react-fontawesome";
|
|
|
|
import { ActionIcon, ActionIconProps } from "@mantine/core";
|
|
|
|
import {
|
|
|
|
|
|
|
|
ActionIcon,
|
|
|
|
|
|
|
|
ActionIconProps,
|
|
|
|
|
|
|
|
Tooltip,
|
|
|
|
|
|
|
|
TooltipProps,
|
|
|
|
|
|
|
|
} from "@mantine/core";
|
|
|
|
import { forwardRef } from "react";
|
|
|
|
import { forwardRef } from "react";
|
|
|
|
|
|
|
|
|
|
|
|
export type ActionProps = ActionIconProps<"button"> & {
|
|
|
|
export type ActionProps = ActionIconProps<"button"> & {
|
|
|
|
icon: IconDefinition;
|
|
|
|
icon: IconDefinition;
|
|
|
|
|
|
|
|
label: string;
|
|
|
|
|
|
|
|
tooltip?: Omit<TooltipProps, "label" | "openDelay" | "children">;
|
|
|
|
iconProps?: Omit<FontAwesomeIconProps, "icon">;
|
|
|
|
iconProps?: Omit<FontAwesomeIconProps, "icon">;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const Action = forwardRef<HTMLButtonElement, ActionProps>(
|
|
|
|
const Action = forwardRef<HTMLButtonElement, ActionProps>(
|
|
|
|
({ icon, iconProps, ...props }, ref) => {
|
|
|
|
({ icon, iconProps, label, tooltip, ...props }, ref) => {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<ActionIcon {...props} ref={ref}>
|
|
|
|
<Tooltip {...tooltip} label={label} openDelay={500}>
|
|
|
|
<FontAwesomeIcon icon={icon} {...iconProps}></FontAwesomeIcon>
|
|
|
|
<ActionIcon aria-label={label} {...props} ref={ref}>
|
|
|
|
</ActionIcon>
|
|
|
|
<FontAwesomeIcon icon={icon} {...iconProps}></FontAwesomeIcon>
|
|
|
|
|
|
|
|
</ActionIcon>
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
);
|
|
|
|