import classNames from 'classnames'; import type { Language } from 'prism-react-renderer'; import { Highlight } from 'prism-react-renderer'; import * as React from 'react'; const theme = { plain: { color: '#EDEDEF', fontSize: 13, fontFamily: 'CommitMono, monospace', }, styles: [ { types: ['comment'], style: { color: '#706F78', }, }, { types: ['atrule', 'keyword', 'attr-name', 'selector'], style: { color: '#7E7D86', }, }, { types: ['punctuation', 'operator'], style: { color: '#706F78', }, }, { types: ['class-name', 'function', 'tag', 'key-white'], style: { color: '#EDEDEF', }, }, ], }; interface CodeBlockProps { children: string; className?: string; codeClassName?: string; language?: Language; isGradientLine?: boolean; } export const CodeBlock: React.FC> = ({ children, language = 'html', className, codeClassName, isGradientLine = true, }) => { const value = children.trim(); return ( {({ tokens, getLineProps, getTokenProps }) => ( <> {isGradientLine && (
)}
            {tokens.map((line, i) => {
              const { key: _, ...lineProps } = getLineProps({ line, key: i });

              return (
                
{line.map((token, key) => { const { key: _, ...tokenProps } = getTokenProps({ token, key, }); const isException = token.content === 'from' && line[key + 1]?.content === ':'; token.types = isException ? [...token.types, 'key-white'] : token.types; return ( ); })}
); })}
{isGradientLine && (
)} )} ); };