"use client"; import {useState} from 'react'; import Link from 'next/link'; export default function Catalog({articles}){const [q,setQ]=useState(''),[topic,setTopic]=useState('Все');const topics=['Все',...new Set(articles.flatMap(a=>a.categories))];const shown=articles.filter(a=>(topic==='Все'||a.categories.includes(topic))&&(a.title+' '+a.excerpt+' '+a.categories.join(' ')).toLocaleLowerCase('ru').includes(q.toLocaleLowerCase('ru')));return

Восстановленные публикации

Архив заметок

{shown.length} из {articles.length}
setQ(e.target.value)} placeholder="Например: Bitrix, D, сертификат"/>
{topics.map(t=>)}

{shown.length ? `Найдено: ${shown.length}`:'Ничего не найдено. Попробуйте другой запрос или тему.'}

{shown.map(a=>
{a.categories[0]} ↗
{a.readingMinutes} мин

{a.title}

{a.excerpt.slice(0,170)}…

)}
}