2021-10-16 03:07:13 +08:00
|
|
|
import React from 'react';
|
|
|
|
import Styled from './styles';
|
|
|
|
|
|
|
|
const PadContent = ({
|
|
|
|
content,
|
2022-04-08 02:35:24 +08:00
|
|
|
}) => {
|
|
|
|
const contentSplit = content.split('<body>');
|
|
|
|
const contentStyle = `
|
|
|
|
<body>
|
|
|
|
<style type="text/css">
|
|
|
|
body {
|
|
|
|
${Styled.contentText}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
`;
|
|
|
|
const contentWithStyle = [contentSplit[0], contentStyle, contentSplit[1]].join('');
|
|
|
|
return (
|
|
|
|
<Styled.Wrapper>
|
|
|
|
<Styled.Iframe
|
|
|
|
title="shared notes viewing mode"
|
|
|
|
srcDoc={contentWithStyle}
|
2022-11-08 00:47:43 +08:00
|
|
|
data-test="sharedNotesViewingMode"
|
2022-04-08 02:35:24 +08:00
|
|
|
/>
|
|
|
|
</Styled.Wrapper>
|
|
|
|
);
|
|
|
|
};
|
2021-10-16 03:07:13 +08:00
|
|
|
|
|
|
|
export default PadContent;
|