Fix turnstile

This commit is contained in:
2026-10-15 15:53:32 +02:00
parent 7dc93ac5ed
commit 70b676660d
80 changed files with 1136 additions and 902 deletions
+10 -14
View File
@@ -2,9 +2,7 @@
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useFormFields } from '@payloadcms/ui';
const fmt = (iso)=>{
if (typeof iso !== 'string' || !iso) {
return '';
}
if (typeof iso !== 'string' || !iso) return '';
const d = new Date(iso);
return Number.isNaN(d.getTime()) ? '' : d.toLocaleString();
};
@@ -12,20 +10,18 @@ const fmt = (iso)=>{
* Status banner on an integration's tab (Site Integrations). Shows nothing until
* the integration has been used once; a red box while it's failing; a short
* green line once it works again.
*/ export function IntegrationStatusBanner({ label, statusField }) {
*/ export function IntegrationStatusBanner({ statusField, label }) {
const state = useFormFields(([f])=>f[`${statusField}.state`]?.value);
const message = useFormFields(([f])=>f[`${statusField}.message`]?.value);
const code = useFormFields(([f])=>f[`${statusField}.code`]?.value);
const since = useFormFields(([f])=>f[`${statusField}.since`]?.value);
const checkedAt = useFormFields(([f])=>f[`${statusField}.checkedAt`]?.value);
if (!state) {
return null;
}
if (!state) return null;
if (state === 'ok') {
return /*#__PURE__*/ _jsxs("div", {
style: {
fontSize: '0.85rem',
marginBottom: '1.5rem',
fontSize: '0.85rem',
opacity: 0.75
},
children: [
@@ -40,11 +36,11 @@ const fmt = (iso)=>{
return /*#__PURE__*/ _jsxs("div", {
role: "alert",
style: {
background: 'var(--theme-error-50, rgba(229, 72, 77, 0.08))',
border: '1px solid var(--theme-error-400, #e5484d)',
borderRadius: 4,
marginBottom: '1.5rem',
padding: '0.9rem 1rem'
padding: '0.9rem 1rem',
borderRadius: 4,
border: '1px solid var(--theme-error-400, #e5484d)',
background: 'var(--theme-error-50, rgba(229, 72, 77, 0.08))'
},
children: [
/*#__PURE__*/ _jsxs("strong", {
@@ -61,8 +57,8 @@ const fmt = (iso)=>{
}) : null,
/*#__PURE__*/ _jsxs("div", {
style: {
fontSize: '0.8rem',
marginTop: '0.35rem',
fontSize: '0.8rem',
opacity: 0.75
},
children: [
@@ -73,8 +69,8 @@ const fmt = (iso)=>{
}),
/*#__PURE__*/ _jsx("div", {
style: {
fontSize: '0.8rem',
marginTop: '0.35rem',
fontSize: '0.8rem',
opacity: 0.75
},
children: "Fix the keys below and save — the status is checked again on the next form submission."