import renderMark from './renderMark';
export default ((data, props) => {
  const {
    text,
    marks
  } = data;
  const hasMarks = !!marks && marks.length > 0;
  if (!hasMarks && !text) {
    return null;
  }
  if (!hasMarks) {
    return text;
  }
  return marks.reduce((accumulator, current) => renderMark(current, accumulator, props), text);
});