'use client' import { type ReactNode } from 'react' export interface CodePreviewProps { /** The code to display */ code: string /** Whether the code is truncated */ isTruncated?: boolean /** Message to show when truncated */ truncatedMessage?: string /** Custom className for the container */ className?: string /** Custom className for the code element */ codeClassName?: string /** Children to render after the code */ children?: ReactNode /** Test ID for the component */ testId?: string } /** * Simple code preview component for displaying code snippets. * * @example * ```tsx * 500} * truncatedMessage="Click to view full code" * /> * ``` */ export function CodePreview({ code, isTruncated = false, truncatedMessage = 'Click to view full code', className = '', codeClassName = '', children, testId, }: CodePreviewProps) { return (
        {code}
      
{isTruncated && (

{truncatedMessage}

)} {children}
) }