This commit is contained in:
2026-01-06 13:55:04 +01:00
parent 297de69928
commit f991ea6b9b
393 changed files with 41362 additions and 4811 deletions

View File

@@ -3,7 +3,6 @@ import Link from 'next/link';
import { notFound } from 'next/navigation';
import { getProductBySlug, getAllProducts, getCategoriesByLocale } from '@/lib/data';
import { getSiteInfo, t, getLocaleFromPath, getLocalizedPath } from '@/lib/i18n';
import { processHTML } from '@/lib/html-compat';
import { SEO } from '@/components/SEO';
import { LocaleSwitcher } from '@/components/LocaleSwitcher';
import { ContentRenderer } from '@/components/content/ContentRenderer';
@@ -74,9 +73,9 @@ export default async function ProductDetailPage({ params }: PageProps) {
notFound();
}
// Process description HTML with WordPress compatibility
const processedDescription = product.descriptionHtml ?
processHTML(product.descriptionHtml) : '';
// Content is already processed during data export
const processedDescription = product.descriptionHtml || '';
const processedShortDescription = product.shortDescriptionHtml || '';
// Get related products (same category)
const allProducts = getAllProducts();
@@ -98,7 +97,7 @@ export default async function ProductDetailPage({ params }: PageProps) {
type="product"
images={product.images}
/>
<div className="bg-white py-12 sm:py-20">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
{/* Back to products link */}
@@ -176,10 +175,13 @@ export default async function ProductDetailPage({ params }: PageProps) {
</p>
)}
{product.shortDescriptionHtml && (
<p className="text-lg text-gray-600 mb-6">
{product.shortDescriptionHtml}
</p>
{processedShortDescription && (
<div className="text-lg text-gray-600 mb-6">
<ContentRenderer
content={processedShortDescription}
className="text-lg text-gray-600"
/>
</div>
)}
{/* Product Description */}
@@ -189,7 +191,7 @@ export default async function ProductDetailPage({ params }: PageProps) {
{t('products.description', locale as 'en' | 'de')}
</h3>
<ContentRenderer
content={product.descriptionHtml || ''}
content={processedDescription}
className="prose prose-sm max-w-none text-gray-600"
/>
</div>
@@ -252,9 +254,12 @@ export default async function ProductDetailPage({ params }: PageProps) {
{relatedProduct.name}
</h3>
{relatedProduct.shortDescriptionHtml && (
<p className="text-sm text-gray-600 line-clamp-2 mb-2">
{relatedProduct.shortDescriptionHtml}
</p>
<div className="text-sm text-gray-600 line-clamp-2 mb-2">
<ContentRenderer
content={relatedProduct.shortDescriptionHtml}
className="text-sm text-gray-600"
/>
</div>
)}
<span className="text-xs text-blue-600 font-medium">
{t('products.viewDetails', locale as 'en' | 'de')}