
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
import { Disposable } from '../../../../base/common/lifecycle.js';
import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.service.js';
import { IHoverService } from '../../../../platform/hover/browser/hover.service.js';
import { localize } from '../../../../nls.js';
import { Codicon } from '../../../../base/common/codicons.js';
import { SimpleButton } from '../../find/browser/findWidget.js';
import { status } from '../../../../base/browser/ui/aria/aria.js';

let HoverCopyButton = class HoverCopyButton extends Disposable {
    constructor(_container, _getContent, _clipboardService, _hoverService) {
        super();
        this._container = _container;
        this._getContent = _getContent;
        this._clipboardService = _clipboardService;
        this._hoverService = _hoverService;
        this._container.classList.add("hover-row-with-copy");
        this._button = this._register(( new SimpleButton({
            label: ( localize(1234, "Copy")),
            icon: Codicon.copy,
            onTrigger: () => this._copyContent(),
            className: "hover-copy-button"
        }, this._hoverService)));
        this._container.appendChild(this._button.domNode);
    }
    async _copyContent() {
        const content = this._getContent();
        if (content) {
            await this._clipboardService.writeText(content);
            status(( localize(1235, "Copied to clipboard")));
        }
    }
};
HoverCopyButton = ( __decorate([( __param(2, IClipboardService)), ( __param(3, IHoverService))], HoverCopyButton));

export { HoverCopyButton };
