import classes from './WdImgButton.module.scss'; import clsx from 'clsx'; import { WithClassName } from '@/hooks/Mapper/types/common.ts'; import { HTMLProps, MouseEvent } from 'react'; import { WdTooltipWrapper, WdTooltipWrapperProps } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper'; export enum WdImageSize { off = 'off', small = 'small', normal = 'normal', large = 'large', } export type WdImgButtonTooltip = Pick; export type WdImgButtonProps = { onClick?(e: MouseEvent): void; source?: string; width?: number; height?: number; tooltip?: WdImgButtonTooltip; textSize?: WdImageSize; } & WithClassName & HTMLProps; export const WdImgButton = ({ onClick, className, source, width = 20, height = 20, textSize = WdImageSize.normal, tooltip, disabled, ...props }: WdImgButtonProps) => { const content = (
{source && }
); if (tooltip) { return {content}; } return content; };