/** * Modal odpowiedzialny za prezentację i eksport analizy artykułu do formatu PDF. * * Odpowiada za: * - wyświetlenie podglądu raportu analitycznego w oknie modalnym, * - przekazanie danych artykułu do generatora PDF, * - obsługę stanu ładowania pełnej treści artykułu, * - inicjację i zakończenie procesu eksportu. */ "use client"; import React from 'react'; import PDFGenerator from './PDFGenerator'; import { Article } from '../lib/fetchNews'; import type { Lang } from '../lib/types'; interface PDFModalProps { article: Article; language: Lang; sentimentLabel: string; sentimentColor: string; fullContent: string; isLoadingContent: boolean; showPDF: boolean; onClose: () => void; onExportStart: () => void; onExportEnd: () => void; } export default function PDFModal({ article, language, sentimentLabel, sentimentColor, fullContent, isLoadingContent, showPDF, onClose, onExportStart, onExportEnd }: PDFModalProps) { if (!showPDF) return null; const T = (pl: string, no: string, en: string) => language === "pl" ? pl : language === "no" ? no : en; return (
{T("Pobieranie pełnej treści...", "Laster inn fullstendig innhold...", "Loading full content...")}
{T("Wygenerowano przez ThruScan Analysis", "Generert av ThruScan Analysis", "Generated by ThruScan Analysis")}
{new Date().toLocaleDateString(language === "pl" ? "pl-PL" : language === "no" ? "no-NO" : "en-US", { year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit' })}