diff --git a/project/frontend/src/components/KennzahlenTable.tsx b/project/frontend/src/components/KennzahlenTable.tsx index 420ed8f..c78bfbb 100644 --- a/project/frontend/src/components/KennzahlenTable.tsx +++ b/project/frontend/src/components/KennzahlenTable.tsx @@ -2,7 +2,7 @@ import { Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Paper, Box, Dialog, DialogActions, DialogContent, DialogTitle, - TextField, Button + TextField, Button, Link } from '@mui/material'; import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline'; import SearchIcon from '@mui/icons-material/Search'; @@ -15,11 +15,16 @@ import { { label: 'Fondsname', value: 'Fund Real Estate Prime Europe', page: 1, status: 'ok' }, { label: 'Fondsmanager', value: '', page: 1, status: 'error' }, { label: 'Risikoprofil', value: 'Core/Core+', page: 10, status: 'warning' }, - { label: 'LTV', value: '30-35 %', page: 8, status: 'ok' } + { label: 'LTV', value: '30-35 %', page: 8, status: 'ok' }, + { label: 'Ausschüttungsrendite', value: '4%', page: 34, status: 'ok' } ]; + interface KennzahlenTableProps { + onPageClick?: (page: number) => void; + } + // React-Komponente - export default function KennzahlenTable() { + export default function KennzahlenTable({ onPageClick }: KennzahlenTableProps) { // Zustand für bearbeitbare Daten const [rows, setRows] = useState(exampleData); @@ -100,7 +105,15 @@ import { {/* Seitenzahl */} - {row.page} + + onPageClick?.(row.page)} + sx={{ cursor: 'pointer' }} + > + {row.page} + + ); })} diff --git a/project/frontend/src/components/pdfViewer.tsx b/project/frontend/src/components/pdfViewer.tsx index 87e1edc..a62a686 100644 --- a/project/frontend/src/components/pdfViewer.tsx +++ b/project/frontend/src/components/pdfViewer.tsx @@ -8,10 +8,11 @@ import { Box, IconButton } from "@mui/material"; interface PDFViewerProps { pitchBookId: string; + currentPage?: number; } -export default function PDFViewer({ pitchBookId }: PDFViewerProps) { +export default function PDFViewer({ pitchBookId, currentPage }: PDFViewerProps) { const [numPages, setNumPages] = useState(null); - const [pageNumber, setPageNumber] = useState(1); + const [pageNumber, setPageNumber] = useState(currentPage || 1); const [containerWidth, setContainerWidth] = useState(null); const containerRef = useRef(null); @@ -31,6 +32,12 @@ export default function PDFViewer({ pitchBookId }: PDFViewerProps) { return () => window.removeEventListener("resize", updateWidth); }, []); + useEffect(() => { + if (currentPage && currentPage !== pageNumber) { + setPageNumber(currentPage); + } + }, [currentPage]); + return ( - + - +