function ArticleRenderer(props) {
const { tnode, TDefaultRenderer, ...defaultRendererProps } = props;
const tchildrenProps = useTNodeChildrenProps(props);
const firstChildrenChunk = tnode.children.slice(0, 2);
const secondChildrenChunk = tnode.children.slice(2, 4);
const thirdChildrenChunk = tnode.children.slice(4, 5);
return (
<TDefaultRenderer tnode={tnode} {...defaultRendererProps}>
<TChildrenRenderer {...tchildrenProps} tchildren={firstChildrenChunk} />
{firstChildrenChunk.length === 2 ? <AdComponent /> : null}
<TChildrenRenderer {...tchildrenProps} tchildren={secondChildrenChunk} />
{secondChildrenChunk.length === 2 ? <AdComponent /> : null}
<TChildrenRenderer {...tchildrenProps} tchildren={thirdChildrenChunk} />
</TDefaultRenderer>
);
};