MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / CodeSnippet

Function CodeSnippet

packages/web/src/app/components/codeSnippet.tsx:3–12  ·  view source on GitHub ↗
({ children, className, title, renderNewlines = false }: { children: React.ReactNode, className?: string, title?: string, renderNewlines?: boolean })

Source from the content-addressed store, hash-verified

1import { cn } from "@/lib/utils"
2
3export const CodeSnippet = ({ children, className, title, renderNewlines = false }: { children: React.ReactNode, className?: string, title?: string, renderNewlines?: boolean }) => {
4 return (
5 <code
6 className={cn("bg-gray-100 dark:bg-gray-700 w-fit rounded-md px-2 py-0.5 font-medium font-mono", className)}
7 title={title}
8 >
9 {renderNewlines ? <pre>{children}</pre> : children}
10 </code>
11 )
12}

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected