2017-08-28 14:05:38 -04:00
|
|
|
import React from 'react';
|
|
|
|
import Markdown from 'react-markdown';
|
|
|
|
import { translateRaw } from 'translations';
|
|
|
|
|
2017-09-24 19:06:28 -07:00
|
|
|
interface Props {
|
|
|
|
translationKey: string;
|
|
|
|
}
|
2017-08-28 14:05:38 -04:00
|
|
|
|
|
|
|
const Translate = ({ translationKey }: Props) => {
|
|
|
|
const source = translateRaw(translationKey);
|
|
|
|
return (
|
|
|
|
<Markdown
|
|
|
|
escapeHtml={true}
|
|
|
|
unwrapDisallowed={true}
|
2018-02-05 16:41:33 -06:00
|
|
|
allowedTypes={['link', 'emphasis', 'strong', 'code', 'root']}
|
|
|
|
renderers={{ root: 'span' }}
|
2017-08-28 14:05:38 -04:00
|
|
|
source={source}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Translate;
|