--- import CategoryBadge from './CategoryBadge.astro'; // цветная плитка рубрик export interface Props { items: any[]; showCount?: boolean; pageInfo?: { hasNextPage: boolean; endCursor: string | null; }; loadMoreConfig?: { type: 'latest' | 'category' | 'author' | 'tag'; slug?: string; first?: number; }; } const { items = [], showCount = false, pageInfo = { hasNextPage: false, endCursor: null }, loadMoreConfig = { type: 'latest', first: 11 } } = Astro.props; function getCoauthorsNames(coauthors: any[]): string { if (!coauthors || coauthors.length === 0) return ''; return coauthors .map((coauthor: any) => coauthor?.node?.name || coauthor?.name) .filter(Boolean) .join(' '); } // ✅ ИСПРАВЛЕННАЯ функция для определения больших карточек // Большие карточки на индексах: 8, 19, 30, 41, 52... // Формула: (index - 8) % 11 === 0 function shouldBeLarge(index: number): boolean { if (index < 8) return false; return (index - 8) % 11 === 0; } ---

{showCount && items.length > 0 && ( ({items.length}) )}

{items.map((item, index) => { const postUrl = item.uri || `/blog/${item.databaseId}`; const postDate = new Date(item.date); const coauthors = item.coauthors || []; const coauthorsNames = getCoauthorsNames(coauthors); // ✅ ИСПРАВЛЕННАЯ логика const isLarge = shouldBeLarge(index); const largePosition = isLarge ? 'first' : ''; return ( ); })}
{pageInfo.hasNextPage && (
)}