Files
klz-cables.com/.pnpm-store/v10/files/1a/5b3405b841f42236c56f567984247d4901699ee778e6b619bfb718bcaeb461a530382c2073596c7b5db6d71cfa695c9bde77a1365dee5ad1d371a14ca18d5e
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

95 lines
2.3 KiB
Plaintext

'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import React, { useCallback } from 'react';
import { toast } from 'sonner';
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { Button } from '../Button/index.js';
import { ConfirmationModal } from '../ConfirmationModal/index.js';
import { Translation } from '../Translation/index.js';
export function GenerateConfirmation(props) {
const $ = _c(12);
const {
highlightField,
setKey
} = props;
const {
id
} = useDocumentInfo();
const {
toggleModal
} = useModal();
const {
t
} = useTranslation();
const modalSlug = `generate-confirmation-${id}`;
let t0;
if ($[0] !== highlightField || $[1] !== setKey || $[2] !== t) {
t0 = () => {
setKey();
toast.success(t("authentication:newAPIKeyGenerated"));
highlightField(true);
};
$[0] = highlightField;
$[1] = setKey;
$[2] = t;
$[3] = t0;
} else {
t0 = $[3];
}
const handleGenerate = t0;
let t1;
if ($[4] !== modalSlug || $[5] !== toggleModal) {
t1 = () => {
toggleModal(modalSlug);
};
$[4] = modalSlug;
$[5] = toggleModal;
$[6] = t1;
} else {
t1 = $[6];
}
let t2;
if ($[7] !== handleGenerate || $[8] !== modalSlug || $[9] !== t || $[10] !== t1) {
t2 = _jsxs(React.Fragment, {
children: [_jsx(Button, {
buttonStyle: "secondary",
onClick: t1,
size: "small",
children: t("authentication:generateNewAPIKey")
}), _jsx(ConfirmationModal, {
body: _jsx(Translation, {
elements: {
1: _temp
},
i18nKey: "authentication:generatingNewAPIKeyWillInvalidate",
t
}),
confirmLabel: t("authentication:generate"),
heading: t("authentication:confirmGeneration"),
modalSlug,
onConfirm: handleGenerate
})]
});
$[7] = handleGenerate;
$[8] = modalSlug;
$[9] = t;
$[10] = t1;
$[11] = t2;
} else {
t2 = $[11];
}
return t2;
}
function _temp(t0) {
const {
children
} = t0;
return _jsx("strong", {
children
});
}
//# sourceMappingURL=index.js.map