- {(articles || []).map((article) => (
-
- ))}
+ {(articles || []).flatMap((article, index) => {
+ const items = [
+
,
+ ];
+ if (index === 1) {
+ items.push(
);
+ }
+ if (index === 4) {
+ items.push(
);
+ }
+ return items;
+ })}
)}
@@ -262,6 +272,7 @@ export default function Home() {
{popular && popular.length > 0 && (
- {articles.map((article) => (
-
- ))}
+ {articles.flatMap((article, index) => {
+ const items = [
+
,
+ ];
+ if (index === 2) {
+ items.push(
);
+ }
+ return items;
+ })}
) : (