import { jsx as _jsx } from "react/jsx-runtime";
import { useEffect } from 'react';
import { Plus as PlusIcon } from '@gravity-ui/icons';
import { Button, Flex, Icon } from '@gravity-ui/uikit';
import { useBooleanState } from "../../../../../../../react-utils/index.js";
export const PlusButton = function YfmTablePlusButton({ qa, onClick, onHoverChange, }) {
    const [hovered, setHovered, unsetHovered] = useBooleanState(false);
    useEffect(() => {
        onHoverChange(hovered);
    }, [hovered, onHoverChange]);
    return (_jsx(Flex, { centerContent: true, width: 20, height: 20, onMouseEnter: setHovered, onMouseLeave: unsetHovered, style: {
            borderRadius: '100px', // button circle border radius
            backgroundColor: hovered ? 'var(--g-color-base-background)' : undefined,
        }, children: _jsx(Button, { qa: qa, size: "xs", pin: "circle-circle", view: hovered ? 'outlined-action' : 'normal', onClick: onClick, style: hovered
                ? {
                    '--g-button-background-color-hover': 'var(--g-color-base-background)',
                }
                : {
                    color: 'transparent',
                    '--g-button-height': '4px',
                    '--g-button-background-color': 'var(--g-color-line-generic-accent)',
                    '--g-button-border-color': 'var(--g-color-line-generic-accent)',
                }, children: _jsx(Icon, { data: PlusIcon }) }) }));
};
//# sourceMappingURL=PlusButton.js.map
