The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/components/Message/Body/Code.tsx

19 lines
454 B

import { Code as ASTCode } from '@rocket.chat/message-parser';
import React, { FC } from 'react';
import CodeLine from './CodeLine';
const Code: FC<{ value: ASTCode['value'] }> = ({ value = [] }) => (
<code className='code-colors hljs'>
{value.map((block, index) => {
switch (block.type) {
case 'CODE_LINE':
return <CodeLine key={index} value={block.value} />;
default:
return null;
}
})}
</code>
);
export default Code;