Files
progcode/web/fsd/widgets/related-reading/index.jsx
T
huncode 12562baeb5
Build and deploy / deploy (push) Successful in 2m39s
Implement ProgCode identity and real shared reading UI kit
2026-10-27 15:19:49 +03:00

4 lines
936 B
React
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import Link from 'next/link';
import {articleHref,articleGenre,readingConnections} from '../../entities/article';
export default function RelatedReading({article,articles}){const connections=article?readingConnections(article,articles):[];if(!connections.length)return <section className="related"><p className="kicker">К СЛЕДУЮЩЕМУ ВОПРОСУ</p><Link href="/#journal">Найти материал в указателе →</Link></section>;return <section className="related" aria-label="Продолжить по смыслу"><p className="kicker">К СЛЕДУЮЩЕМУ ВОПРОСУ</p>{connections.map(({article:item,reason})=><Link className="continuation" key={item.slug} href={articleHref(item)}><span className="tiny-topic">{articleGenre(item)} · {item.categories.join(' / ')}</span><strong>{item.title}</strong><span className="reason">{reason}</span><span aria-hidden="true">→</span></Link>)}</section>}