From b1ed7518b1d9364d5a8e59c194d7d4170a32bc49 Mon Sep 17 00:00:00 2001
From: Usman Baig element. We intercept
to extract filename and render CodeBlock.
const mdxComponents = {
- pre: ({ children }: { children: React.ReactNode }) => children,
- code: ({ children, className, filename, ...props }: {
- children: React.ReactNode
- className?: string
+ pre: ({ children, filename, ...props }: {
+ children: React.ReactElement
filename?: string
[key: string]: unknown
}) => {
- // Block code (inside ) has className like "language-tsx"
- if (className?.startsWith('language-') || filename) {
+ const code = children?.props?.children
+ if (typeof code === 'string') {
return (
{children}
+ return {children}
},
}
diff --git a/components/IntegrationGuide.tsx b/components/IntegrationGuide.tsx
index 22f0f5c..516e49f 100644
--- a/components/IntegrationGuide.tsx
+++ b/components/IntegrationGuide.tsx
@@ -7,7 +7,7 @@
*/
import Link from 'next/link'
-import { ArrowLeftIcon, ArrowRightIcon } from '@ciphera-net/ui'
+import { ArrowLeftIcon, ArrowRightIcon, CodeBlock } from '@ciphera-net/ui'
import { type ReactNode } from 'react'
import { type Integration, getIntegration, categoryLabels } from '@/lib/integrations'
@@ -92,7 +92,7 @@ export function IntegrationGuide({ integration, children }: IntegrationGuideProp
Detect rage clicks and dead clicks by adding the frustration tracking
add-on after the core script:
{``}
+
No extra configuration needed. Add data-no-rage or{' '}
data-no-dead to disable individual signals.