import { useUiTranslation as e } from "../../../../i18n/useUiTranslation.js";
import t from "../../../../hooks/useClipboardCopy.js";
import { MarkdownCopySuccessSvg as n } from "../../../../icons/markdown/MarkdownCopySuccessSvg.js";
import { MarkdownCopySvg as r } from "../../../../icons/markdown/MarkdownCopySvg.js";
import { copyButton as i, icon as a, label as o } from "./MarkdownCodeCopyButton.css.js";
import { jsx as s, jsxs as c } from "react/jsx-runtime";
//#region src/atomic/molecules/markdown/components/MarkdownCodeCopyButton.tsx
var l = ({ code: l }) => {
	let { t: u } = e(), { copiedKey: d, copyText: f } = t(), p = d === l, m = u("markdown.code.copyTitle");
	p && (m = u("markdown.code.copiedTitle"));
	let h = /* @__PURE__ */ s(r, { className: a });
	p && (h = /* @__PURE__ */ s(n, { className: a }));
	let g = u("markdown.code.copy");
	return p && (g = u("markdown.code.copied")), /* @__PURE__ */ c("button", {
		className: i,
		onClick: () => {
			f(l, l).catch(() => {});
		},
		title: m,
		type: "button",
		children: [h, /* @__PURE__ */ s("span", {
			className: o,
			children: g
		})]
	});
};
//#endregion
export { l as MarkdownCodeCopyButton };

//# sourceMappingURL=MarkdownCodeCopyButton.js.map