| 119 | } |
| 120 | |
| 121 | function EditorBlock({ code, language, label, className = '' }: { code: string; language?: string; label?: string; className?: string }) { |
| 122 | const { copied, copy } = useCopy(code) |
| 123 | const tab = label || language || 'bash' |
| 124 | return ( |
| 125 | <div className={`rounded-xl overflow-hidden border border-[#e5e5e5] dark:border-[#222] bg-[#f6f6f6] dark:bg-[#0c0c0c] ${className}`}> |
| 126 | <div className="flex items-center justify-between border-b border-[#e0e0e0] dark:border-[#1a1a1a] bg-[#efefef] dark:bg-[#111] px-1"> |
| 127 | <div className="flex items-center"> |
| 128 | <div className="px-4 py-2.5 border-b-2 border-[#111] dark:border-white"> |
| 129 | <span className="font-mono text-xs text-[#111] dark:text-white">{tab}</span> |
| 130 | </div> |
| 131 | </div> |
| 132 | <CopyButton copied={copied} copy={copy} /> |
| 133 | </div> |
| 134 | <div className="overflow-x-auto p-5"> |
| 135 | <pre className="text-sm font-mono leading-7"> |
| 136 | <CodeLines code={code} /> |
| 137 | </pre> |
| 138 | </div> |
| 139 | </div> |
| 140 | ) |
| 141 | } |
| 142 | |
| 143 | function InlineBlock({ code, className = '' }: { code: string; className?: string }) { |
| 144 | const { copied, copy } = useCopy(code) |