({
snippet,
lang,
showLineNumbers,
fileName,
highlightLines,
highlightWords
}: CodeBlockCardProps)
| 15 | }; |
| 16 | |
| 17 | function CodeBlockCard({ |
| 18 | snippet, |
| 19 | lang, |
| 20 | showLineNumbers, |
| 21 | fileName, |
| 22 | highlightLines, |
| 23 | highlightWords |
| 24 | }: CodeBlockCardProps) { |
| 25 | return ( |
| 26 | <div className="mb-4 p-2.5 border bg-[#f9fafb] rounded-[1.75rem] dark:bg-[#111827]"> |
| 27 | <div className="flex items-center gap-1.5 text-gray-500 dark:text-[#9CA3AF] px-5 pb-4 pt-1.5"> |
| 28 | <h5 className="mr-auto text-sm font-mono font-[84]"> |
| 29 | {fileName || "terminal"} |
| 30 | </h5> |
| 31 | |
| 32 | <CopyToClipboard content={snippet.trim()} showLabel /> |
| 33 | </div> |
| 34 | |
| 35 | <div className="max-h-120 border bg-[#f9fafb] overflow-auto rounded-[1.25rem] dark:bg-[#111827] shadow-terminal"> |
| 36 | <CodeBlock |
| 37 | snippet={snippet.trim()} |
| 38 | lang={lang} |
| 39 | showLineNumbers={showLineNumbers} |
| 40 | highlightLines={highlightLines} |
| 41 | highlightWords={highlightWords} |
| 42 | /> |
| 43 | </div> |
| 44 | </div> |
| 45 | ); |
| 46 | } |
| 47 | |
| 48 | export default memo(CodeBlockCard); |
nothing calls this directly
no outgoing calls
no test coverage detected