Skip to content

armgit / mapcn

Public Imported from GitHub
0

Beautiful map components. 100% Free, Zero config, one command setup.

TypeScript
622 B
Raw Blame
import { highlightCode } from "@/lib/highlight";
import { ComponentPreviewClient } from "./component-preview-client";

interface ComponentPreviewProps {
  children: React.ReactNode;
  code: string;
  height?: string;
  className?: string;
}

export async function ComponentPreview({
  children,
  code,
  height,
  className,
}: ComponentPreviewProps) {
  const highlightedCode = await highlightCode(code, "tsx");

  return (
    <ComponentPreviewClient
      code={code}
      highlightedCode={highlightedCode}
      height={height}
      className={className}
    >
      {children}
    </ComponentPreviewClient>
  );
}