Разбиение на файлы
import React from 'react';
export default function PrintRectText(props) {
const {paramsObj} = props;
const contentValue = paramsObj.contentValue;
const backgroundType = paramsObj.backgroundType;
console.log(contentValue + " ___ " + backgroundType);
if(backgroundType === "R") {
return (
<span style={{background: 'red', padding: '10px'}}>
<b>
{contentValue}
</b>
</span>
);
}
if(backgroundType === "G") {
return (
<span style={{background: 'green', padding: '10px'}}>
<b>
{contentValue}
</b>
</span>
);
}
return (
<span style={{background: 'blue', padding: '10px'}}>
<b>
{contentValue}
</b>
</span>
);
}Last updated