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/Italic.tsx

28 lines
665 B

import { Italic as ASTItalic } from '@rocket.chat/message-parser';
import React, { FC } from 'react';
import Bold from './Bold';
import Link from './Link';
import Strike from './Strike';
const Italic: FC<{ value: ASTItalic['value'] }> = ({ value = [] }) => (
<i>
{value.map((block, index) => {
switch (block.type) {
case 'LINK':
return <Link key={index} value={block.value} />;
case 'PLAIN_TEXT':
return block.value;
case 'STRIKE':
return <Strike key={index} value={block.value} />;
case 'BOLD':
return <Bold key={index} value={block.value} />;
default:
return null;
}
})}
</i>
);
export default Italic;