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

27 lines
668 B

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