diff --git a/app/[locale]/products/[...slug]/page.tsx b/app/[locale]/products/[...slug]/page.tsx index b64a28d0..9d8d198a 100644 --- a/app/[locale]/products/[...slug]/page.tsx +++ b/app/[locale]/products/[...slug]/page.tsx @@ -2,7 +2,6 @@ import ProductSidebar from '@/components/ProductSidebar'; import ProductTabs from '@/components/ProductTabs'; import ProductTechnicalData from '@/components/ProductTechnicalData'; import RelatedProducts from '@/components/RelatedProducts'; -import RequestQuoteForm from '@/components/RequestQuoteForm'; import { Badge, Container, Section } from '@/components/ui'; import { getDatasheetPath } from '@/lib/datasheets'; import { getAllProducts, getProductBySlug } from '@/lib/mdx'; @@ -66,33 +65,33 @@ export async function generateMetadata({ params }: ProductPageProps): Promise

, + p: (props: any) =>

, h2: (props: any) => ( -

-

+
+

), - h3: (props: any) =>

, - ul: (props: any) =>
    , + h3: (props: any) =>

    , + ul: (props: any) =>
      , section: (props: any) =>
      , li: (props: any) => ( -
    • +
    • ), strong: (props: any) => , table: (props: any) => ( -
      +
      ), th: (props: any) =>
      , td: (props: any) => , - hr: () =>
      , + hr: () =>
      , blockquote: (props: any) => ( -
      +
      @@ -201,6 +200,30 @@ export default async function ProductPage({ params }: ProductPageProps) { const categoryKey = categorySlug.replace(/-cables$/, '').replace(/-([a-z])/g, (g) => g[1].toUpperCase()); const categoryTitle = t(`categories.${categoryKey}.title`); + const sidebar = ( + + ); + + const productComponents = { + ...components, + ProductTabs: (props: any) => , + }; + + // Pre-process content to convert raw HTML tags to Markdown so they use our custom components + const processedContent = product.content + .replace(/]*>(.*?)<\/h2>/g, '\n## $1\n') + .replace(/]*>(.*?)<\/h3>/g, '\n### $1\n') + .replace(/]*>(.*?)<\/p>/g, '\n$1\n') + .replace(/]*>(.*?)<\/ul>/gs, '\n$1\n') + .replace(/]*>(.*?)<\/li>/g, '\n- $1\n') + .replace(/]*>(.*?)<\/strong>/g, '**$1**') + .replace(/]*>/g, '') + .replace(/<\/section>/g, ''); + return (
      {/* Product Hero */} @@ -278,84 +301,37 @@ export default async function ProductPage({ params }: ProductPageProps) { )}
      -
      - {/* Sidebar on Mobile (Above Content) */} -
      -
      - {/* Request Quote Form */} -
      -
      -
      -

      {t('requestQuote')}

      -

      {t('requestQuoteDesc')}

      -
      -
      - -
      -
      - - {/* Datasheet Download */} - {datasheetPath && ( - -
      -
      - - - -
      -
      -

      {t('downloadDatasheet')}

      -

      {t('downloadDatasheetDesc')}

      -
      -
      -
      - )} -
      +
      + {/* Main Content Area */} +
      +
      -
      - {/* Main Content Area */} -
      - -
      - - {/* Structured Data */} -