Files
klz-cables.com/.pnpm-store/v10/files/f5/ee39ef576b587109f6c306deebc0c2b5c578c60e2a22d7b70a0b9fdf86ab821e9b1f08281b95367a9abe01375fb6ef433fa2c120d171f4cf43b1b17f13692d
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

121 lines
2.9 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 from 'react';
import { useAuth } from '../../providers/Auth/index.js';
import { SelectAllStatus, useSelection } from '../../providers/Selection/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { ListSelectionButton } from '../ListSelection/index.js';
import { PublishManyDrawerContent } from './DrawerContent.js';
export const PublishMany = props => {
const $ = _c(8);
const {
count,
selectAll,
selectedIDs,
toggleAll
} = useSelection();
let t0;
if ($[0] !== toggleAll) {
t0 = () => toggleAll();
$[0] = toggleAll;
$[1] = t0;
} else {
t0 = $[1];
}
const t1 = selectAll === SelectAllStatus.AllAvailable;
let t2;
if ($[2] !== count || $[3] !== props || $[4] !== selectedIDs || $[5] !== t0 || $[6] !== t1) {
t2 = _jsx(PublishMany_v4, {
...props,
count,
ids: selectedIDs,
onSuccess: t0,
selectAll: t1
});
$[2] = count;
$[3] = props;
$[4] = selectedIDs;
$[5] = t0;
$[6] = t1;
$[7] = t2;
} else {
t2 = $[7];
}
return t2;
};
export const PublishMany_v4 = props => {
const $ = _c(12);
const {
collection,
collection: t0,
count,
ids,
modalPrefix,
onSuccess,
selectAll,
where
} = props;
const {
slug,
versions
} = t0 === undefined ? {} : t0;
const {
permissions
} = useAuth();
const {
t
} = useTranslation();
const {
openModal
} = useModal();
const collectionPermissions = permissions?.collections?.[slug];
const hasPermission = collectionPermissions?.update;
const drawerSlug = `${modalPrefix ? `${modalPrefix}-` : ""}publish-${slug}`;
if (!versions?.drafts || count === 0 || !hasPermission) {
return null;
}
let t1;
if ($[0] !== collection || $[1] !== drawerSlug || $[2] !== ids || $[3] !== onSuccess || $[4] !== openModal || $[5] !== selectAll || $[6] !== t || $[7] !== where) {
let t2;
if ($[9] !== drawerSlug || $[10] !== openModal) {
t2 = () => {
openModal(drawerSlug);
};
$[9] = drawerSlug;
$[10] = openModal;
$[11] = t2;
} else {
t2 = $[11];
}
t1 = _jsxs(React.Fragment, {
children: [_jsx(ListSelectionButton, {
"aria-label": t("version:publish"),
onClick: t2,
children: t("version:publish")
}), _jsx(PublishManyDrawerContent, {
collection,
drawerSlug,
ids,
onSuccess,
selectAll,
where
})]
});
$[0] = collection;
$[1] = drawerSlug;
$[2] = ids;
$[3] = onSuccess;
$[4] = openModal;
$[5] = selectAll;
$[6] = t;
$[7] = where;
$[8] = t1;
} else {
t1 = $[8];
}
return t1;
};
//# sourceMappingURL=index.js.map