import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { Popup } from '@gravity-ui/uikit';
import { cn } from "../../../../classname.js";
import { LinkForm } from "../../../../forms/LinkForm.js";
import { i18n } from "../../../../i18n/widgets/index.js";
import { useElementState } from "../../../../react-utils/index.js";
import "./widget.css";
const b = cn('link-placeholder-widget');
const placement = ['bottom-start', 'top-start', 'bottom-end', 'top-end'];
export const LinkPlaceholderWidget = ({ onCancel, onSubmit, }) => {
    const [anchor, setAnchor] = useElementState();
    return (_jsxs(_Fragment, { children: [_jsx("span", { ref: setAnchor, className: b(), children: _jsx("a", { href: "#", children: i18n('link') }) }), _jsx(Popup, { qa: "g-md-link-form", open: true, modal: true, onOpenChange: onCancel, anchorElement: anchor, placement: placement, children: _jsx(LinkForm, { autoFocus: true, onSubmit: onSubmit, onCancel: onCancel }) })] }));
};
//# sourceMappingURL=widget.js.map
