typescript-typenfehler behoben.. npm run lint läuft nun fehlerfrei durch.

This commit is contained in:
Codex Agent
2025-11-22 11:49:47 +01:00
parent 6c78d7e281
commit eb41cb6194
74 changed files with 469 additions and 396 deletions

View File

@@ -139,7 +139,7 @@ export const PaymentStep: React.FC = () => {
const [couponLoading, setCouponLoading] = useState(false);
const paddleRef = useRef<typeof window.Paddle | null>(null);
const checkoutContainerRef = useRef<HTMLDivElement | null>(null);
const eventCallbackRef = useRef<(event: any) => void>();
const eventCallbackRef = useRef<(event: Record<string, unknown>) => void>();
const hasAutoAppliedCoupon = useRef(false);
const checkoutContainerClass = 'paddle-checkout-container';
@@ -149,7 +149,6 @@ export const PaymentStep: React.FC = () => {
}, [i18n.language]);
const isFree = useMemo(() => (selectedPackage ? Number(selectedPackage.price) <= 0 : false), [selectedPackage]);
const hasCoupon = Boolean(couponPreview);
const applyCoupon = useCallback(async (code: string) => {
if (!selectedPackage) {
@@ -339,7 +338,7 @@ export const PaymentStep: React.FC = () => {
console.info('[Checkout] Hosted checkout response', { status: response.status, rawBody });
}
let data: any = null;
let data: { checkout_url?: string; message?: string } | null = null;
try {
data = rawBody && rawBody.trim().startsWith('{') ? JSON.parse(rawBody) : null;
} catch (parseError) {
@@ -354,7 +353,7 @@ export const PaymentStep: React.FC = () => {
if (/^https?:\/\//i.test(trimmed)) {
checkoutUrl = trimmed;
} else if (trimmed.startsWith('<')) {
const match = trimmed.match(/https?:\/\/["'a-zA-Z0-9._~:\/?#\[\]@!$&'()*+,;=%-]+/);
const match = trimmed.match(/https?:\/\/["'a-zA-Z0-9._~:/?#@!$&'()*+,;=%-]+/);
if (match) {
checkoutUrl = match[0];
}
@@ -444,7 +443,7 @@ export const PaymentStep: React.FC = () => {
locale: paddleLocale,
},
},
eventCallback: (event: any) => eventCallbackRef.current?.(event),
eventCallback: (event: Record<string, unknown>) => eventCallbackRef.current?.(event),
});
inlineReady = true;