import React from 'react'; import { CurrentView, ResearchPaper } from '../types'; import { SECTION_IDS, RESEARCH_PAPER_DETAIL_CONTENT } from '../constants'; // Removed mockResearchPapers import Button from './Button'; import { ArrowUturnLeftIcon, ChevronRightIcon } from './icons'; import ItemDetailNavigation from './ItemDetailNavigation'; import ResearchCard from './ResearchCard'; import GalleryComponent from './GalleryComponent'; // Import GalleryComponent interface ResearchPaperDetailProps { itemId: string; allResearchPapers: ResearchPaper[]; setCurrentView: (view: CurrentView) => void; setSelectedItemId: (id: string | null) => void; } const ResearchPaperDetail: React.FC = ({ itemId, allResearchPapers, setCurrentView, setSelectedItemId }) => { const paper = allResearchPapers.find(p => p.id === itemId); const handleBackClick = () => { setCurrentView('researchAll'); setSelectedItemId(null); }; const handleNavigateItem = (newItemId: string) => { setSelectedItemId(newItemId); }; const handleShowAllKeepReading = (e: React.MouseEvent) => { e.preventDefault(); setCurrentView('researchAll'); setSelectedItemId(null); }; if (!paper) { return (

{RESEARCH_PAPER_DETAIL_CONTENT.notFoundTitle}

); } const currentIndex = allResearchPapers.findIndex(p => p.id === itemId); const previousPaper = currentIndex > 0 ? allResearchPapers[currentIndex - 1] : undefined; const nextPaper = currentIndex < allResearchPapers.length - 1 ? allResearchPapers[currentIndex + 1] : undefined; const relatedPapers = allResearchPapers .filter(p => p.id !== itemId) .slice(0, 3); return (
{paper.imageUrl && (
{paper.title}
)}

{paper.title}

{paper.category} {paper.date} {paper.authors && paper.authors.length > 0 && ( <> Авторы: {paper.authors.join(', ')} )}
{paper.abstract && (

{RESEARCH_PAPER_DETAIL_CONTENT.abstractTitle}

{paper.abstract}

)} {typeof paper.fullContent === 'string' ? (
) : ( paper.fullContent )}
{paper.gallery && paper.gallery.length > 0 && ( )}
{relatedPapers.length > 0 && (

{RESEARCH_PAPER_DETAIL_CONTENT.keepReadingTitle || "Дальнейшие исследования"}

{RESEARCH_PAPER_DETAIL_CONTENT.viewAllButtonText || `Все ${RESEARCH_PAPER_DETAIL_CONTENT.itemTypePlural}`}
{relatedPapers.map(relatedPaper => ( ))}
)}
); }; export default ResearchPaperDetail;