'use client'

import { Code } from '@sim/emcn'

interface CodeBlockProps {
  code: string
  language: 'javascript' | 'json' | 'python'
}

export function CodeBlock({ code, language }: CodeBlockProps) {
  return (
    <div className='dark w-full overflow-hidden rounded-md border border-[var(--border)] bg-[var(--code-bg)] text-sm'>
      <Code.Viewer
        code={code}
        showGutter
        language={language}
        className='[&_pre]:!pb-0 m-0 rounded-none border-0 bg-transparent'
      />
    </div>
  )
}
