import clsx from "clsx"; import type { ReactNode } from "react"; import { CodeCardDivider, codeCardClassName, codeCardHeaderClassName, codeViewportClassName, } from "./code-card"; import { CopyButton } from "./copy-button"; interface SeedCodeBlockProps { title?: ReactNode; icon?: ReactNode; className?: string; /** Highlighted code, typically a Fumadocs `
` element. */
  children: ReactNode;
}

/**
 * Presentational single code block card (Figma "Codeblock"). Contains no highlighting
 * logic, so it is safe to render from both server and client trees.
 *
 * With a `title` (filename), it shows a header row (icon + title + copy) and a divider.
 * Without one, the header is omitted and the copy button floats at the top-right of the
 * code, matching Fumadocs' original title-less behavior.
 */
export function SeedCodeBlock({ title, icon, className, children }: SeedCodeBlockProps) {
  const hasHeader = Boolean(title);

  return (
    
{hasHeader ? ( <>
{icon ? ( typeof icon === "string" ? ( ) : ( {icon} ) ) : null}
{title}
) : ( )}
{children}
); }