"use client"; import dynamic from "next/dynamic"; import type { ComponentType } from "react"; interface ClientOnlySectionProps { loader: () => Promise<{ default: ComponentType }>; props: Record; } const cache = new Map<() => Promise<{ default: ComponentType }>, ComponentType>(); export function ClientOnlySection({ loader, props }: ClientOnlySectionProps) { let Dynamic = cache.get(loader); if (!Dynamic) { Dynamic = dynamic(loader, { ssr: false }); cache.set(loader, Dynamic); } return ; }