Compare commits

..

No commits in common. "6285be6d40b164c927cfbdc48ea1ea599fa3e913" and "4a347951e906b4770425b0042a2f2abefca46872" have entirely different histories.

7 changed files with 99 additions and 292 deletions

View File

@ -1,46 +1,12 @@
from typing import Dict, List
def validate_entities(entities): def validate_entities(entities):
result = [] return entities
reduced_kpi: Dict[str, List[Dict[str, str | int]]] = {} #todo
for item in entities: valid = []
label = item["label"] for entity in entities:
if label not in reduced_kpi: if entity["type"] == "PERSON":
reduced_kpi[label] = [] if entity["name"] == "John Doe":
reduced_kpi[label].append(item) valid.append(entity)
elif entity["type"] == "ORG":
for item in reduced_kpi.items(): if entity["name"] == "Exxeta":
if item[0] == "FONDSNAME": valid.append(entity)
result.extend(item[1]) return valid
continue
elif item[0] == "DATUM":
result.extend(item[1])
continue
elif item[0] == "FONDSMANAGER":
result.extend(item[1])
continue
validated = False
for entity in item[1]:
if entity["status"] == "validated":
validated = True
if validated:
item_list = [x for x in item[1] if x["status"] == "validated"]
result.extend(item_list)
else:
result.extend(item[1])
return result
if __name__ == "__main__":
entities = [
{"label": "PERSON", "entity": "John Doe", "status": "validated"},
{"label": "PERSON", "entity": "Exxeta", "status": "invalid"},
{"label": "ORG", "entity": "Google", "status": "invalid"},
{"label": "FONDSNAME", "entity": "Microsoft", "status": "validated"},
{"label": "FONDSNAME", "entity": "Amazon", "status": "invalid"},
{"label": "FONDSNAME", "entity": "Apple", "status": "invalid"}
]
print(validate_entities(entities))

View File

@ -22,7 +22,7 @@ import type { KeyboardEvent } from "react";
import { fetchPutKPI } from "../util/api"; import { fetchPutKPI } from "../util/api";
interface KennzahlenTableProps { interface KennzahlenTableProps {
onPageClick?: (page: number, text: string) => void; onPageClick?: (page: number) => void;
pdfId: string; pdfId: string;
settings: Kennzahl[]; settings: Kennzahl[];
data: { data: {
@ -286,22 +286,15 @@ export default function KennzahlenTable({
)} )}
</TableCell> </TableCell>
<TableCell align="center"> <TableCell align="center">
{(row.extractedValues.at(0)?.page ?? 0) > 0 ? (
<Link <Link
component="button" component="button"
onClick={() => { onClick={() =>
const extractedValue = row.extractedValues.at(0); onPageClick?.(Number(row.extractedValues.at(0)?.page))
if (extractedValue?.page && extractedValue.page > 0) {
onPageClick?.(Number(extractedValue.page), extractedValue.entity || "");
} }
}}
sx={{ cursor: "pointer" }} sx={{ cursor: "pointer" }}
> >
{row.extractedValues.at(0)?.page} {row.extractedValues.at(0)?.page}
</Link> </Link>
) : (
""
)}
</TableCell> </TableCell>
</TableRow> </TableRow>
); );

View File

@ -1,42 +1,28 @@
import { useCallback, useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { Document, Page } from "react-pdf"; import { Document, Page } from "react-pdf";
import "react-pdf/dist/esm/Page/AnnotationLayer.css"; import "react-pdf/dist/esm/Page/AnnotationLayer.css";
import "react-pdf/dist/esm/Page/TextLayer.css"; import "react-pdf/dist/esm/Page/TextLayer.css";
import ArrowCircleLeftIcon from "@mui/icons-material/ArrowCircleLeft"; import ArrowCircleLeftIcon from "@mui/icons-material/ArrowCircleLeft";
import ArrowCircleRightIcon from "@mui/icons-material/ArrowCircleRight"; import ArrowCircleRightIcon from "@mui/icons-material/ArrowCircleRight";
import { Box, IconButton } from "@mui/material"; import { Box, IconButton } from "@mui/material";
import type {
CustomTextRenderer,
OnGetTextSuccess,
} from "node_modules/react-pdf/dist/esm/shared/types";
import { socket } from "../socket"; import { socket } from "../socket";
import { highlightPattern } from "../util/highlighting";
interface PDFViewerProps { interface PDFViewerProps {
pitchBookId: string; pitchBookId: string;
currentPage?: number; currentPage?: number;
onPageChange?: (page: number) => void; onPageChange?: (page: number) => void;
highlight: { text: string; page: number }[];
focusHighlight: { text: string; page: number };
} }
export default function PDFViewer({ export default function PDFViewer({
pitchBookId, pitchBookId,
currentPage, currentPage,
onPageChange, onPageChange,
highlight = [],
focusHighlight,
}: PDFViewerProps) { }: PDFViewerProps) {
const [numPages, setNumPages] = useState<number | null>(null); const [numPages, setNumPages] = useState<number | null>(null);
const [pageNumber, setPageNumber] = useState(currentPage || 1); const [pageNumber, setPageNumber] = useState(currentPage || 1);
const [containerWidth, setContainerWidth] = useState<number | null>(null); const [containerWidth, setContainerWidth] = useState<number | null>(null);
const [pdfKey, setPdfKey] = useState(Date.now()); const [pdfKey, setPdfKey] = useState(Date.now());
const containerRef = useRef<HTMLDivElement>(null); const containerRef = useRef<HTMLDivElement>(null);
const [posHighlight, setPosHighlight] = useState<string[]>([]);
const [posHighlightFocus, setPosHighlightFocus] = useState<string[]>([]);
const [textContent, setTextContent] = useState<
{ posKey: string; text: string; i: number }[]
>([]);
const onDocumentLoadSuccess = ({ numPages }: { numPages: number }) => { const onDocumentLoadSuccess = ({ numPages }: { numPages: number }) => {
setNumPages(numPages); setNumPages(numPages);
@ -58,7 +44,7 @@ export default function PDFViewer({
if (currentPage && currentPage !== pageNumber) { if (currentPage && currentPage !== pageNumber) {
setPageNumber(currentPage); setPageNumber(currentPage);
} }
}, [currentPage, pageNumber]); }, [currentPage]);
useEffect(() => { useEffect(() => {
const handleProgress = (data: { id: number; progress: number }) => { const handleProgress = (data: { id: number; progress: number }) => {
@ -79,78 +65,6 @@ export default function PDFViewer({
onPageChange?.(newPage); onPageChange?.(newPage);
}; };
const textRenderer: CustomTextRenderer = useCallback(
(textItem) => {
return highlightPattern(
textItem.str,
`${textItem.width};${textItem.height};${textItem.transform}`,
posHighlight,
posHighlightFocus,
);
},
[posHighlight, posHighlightFocus],
);
useEffect(() => {
const tmpPos: string[] = [];
const tmpPosHighlight: string[] = [];
const textItems = textContent.filter(
(e) => e.text !== "" && e.text !== " ",
);
textItems.forEach((e, i) => {
for (const s of highlight
.filter((h) => h.page === pageNumber)
.map((h) => h.text)) {
if (s.split(" ")[0] === e.text) {
if (
s.split(" ").reduce((prev, curr, j) => {
return prev && curr === textItems[i + j].text;
}, true)
) {
for (
let k = textItems[i].i;
k < textItems[i + s.split(" ").length].i;
k++
) {
tmpPos.push(textContent[k].posKey);
}
}
}
}
if (focusHighlight?.page === pageNumber) {
if (focusHighlight.text.split(" ")[0] === e.text) {
if (
focusHighlight.text.split(" ").reduce((prev, curr, j) => {
return prev && curr === textItems[i + j].text;
}, true)
) {
for (
let k = textItems[i].i;
k < textItems[i + focusHighlight.text.split(" ").length].i;
k++
) {
tmpPosHighlight.push(textContent[k].posKey);
}
}
}
}
});
setPosHighlight(tmpPos);
setPosHighlightFocus(tmpPosHighlight);
}, [highlight, focusHighlight, pageNumber, textContent]);
const onGetTextSuccess: OnGetTextSuccess = useCallback((fullText) => {
setTextContent(
fullText.items.map((e, i) => ({
posKey: `${"width" in e ? e.width : 0};${"height" in e ? e.height : 0};${"transform" in e ? e.transform : ""}`,
text: "str" in e ? e.str : "",
i,
})),
);
}, []);
return ( return (
<Box <Box
display="flex" display="flex"
@ -180,12 +94,7 @@ export default function PDFViewer({
onSourceError={(error) => console.error("Ungültige PDF:", error)} onSourceError={(error) => console.error("Ungültige PDF:", error)}
> >
{containerWidth && ( {containerWidth && (
<Page <Page pageNumber={pageNumber} width={containerWidth * 0.98} />
pageNumber={pageNumber}
width={containerWidth * 0.98}
customTextRenderer={textRenderer}
onGetTextSuccess={onGetTextSuccess}
/>
)} )}
</Document> </Document>
</Box> </Box>

View File

@ -3,7 +3,6 @@ import { ThemeProvider, createTheme } from "@mui/material/styles";
import { RouterProvider, createRouter } from "@tanstack/react-router"; import { RouterProvider, createRouter } from "@tanstack/react-router";
import { StrictMode } from "react"; import { StrictMode } from "react";
import ReactDOM from "react-dom/client"; import ReactDOM from "react-dom/client";
import "react-pdf/dist/Page/TextLayer.css";
import "@fontsource/roboto/300.css"; import "@fontsource/roboto/300.css";
import "@fontsource/roboto/400.css"; import "@fontsource/roboto/400.css";
@ -13,7 +12,6 @@ import "@fontsource/roboto/700.css";
import * as TanStackQueryProvider from "./integrations/tanstack-query/root-provider.tsx"; import * as TanStackQueryProvider from "./integrations/tanstack-query/root-provider.tsx";
import { pdfjs } from "react-pdf"; import { pdfjs } from "react-pdf";
// Import the generated route tree // Import the generated route tree
import { routeTree } from "./routeTree.gen"; import { routeTree } from "./routeTree.gen";

View File

@ -3,7 +3,7 @@ import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import { Box, Button, Paper, Typography, IconButton } from "@mui/material"; import { Box, Button, Paper, Typography, IconButton } from "@mui/material";
import { useSuspenseQuery } from "@tanstack/react-query"; import { useSuspenseQuery } from "@tanstack/react-query";
import { createFileRoute, useNavigate } from "@tanstack/react-router"; import { createFileRoute, useNavigate } from "@tanstack/react-router";
import { useCallback, useState } from "react"; import { useState } from "react";
import KennzahlenTable from "../components/KennzahlenTable"; import KennzahlenTable from "../components/KennzahlenTable";
import PDFViewer from "../components/pdfViewer"; import PDFViewer from "../components/pdfViewer";
import { kpiQueryOptions, settingsQueryOptions } from "../util/query"; import { kpiQueryOptions, settingsQueryOptions } from "../util/query";
@ -36,15 +36,6 @@ function ExtractedResultsPage() {
const { from } = Route.useSearch(); const { from } = Route.useSearch();
const status: "green" | "yellow" | "red" = "red"; const status: "green" | "yellow" | "red" = "red";
const [currentPage, setCurrentPage] = useState(1); const [currentPage, setCurrentPage] = useState(1);
const [focusHighlight, setFocusHighlight] = useState({
page: 5,
text: "Langjährige",
});
const onSiteClick = useCallback((page: number, entity: string) => {
setCurrentPage(page);
setFocusHighlight({ page, text: entity });
}, []);
const statusColor = { const statusColor = {
red: "#f43131", red: "#f43131",
@ -104,7 +95,7 @@ function ExtractedResultsPage() {
> >
<KennzahlenTable <KennzahlenTable
settings={settings} settings={settings}
onPageClick={onSiteClick} onPageClick={setCurrentPage}
data={kpi} data={kpi}
pdfId={pitchBook} pdfId={pitchBook}
from={from} from={from}
@ -138,13 +129,6 @@ function ExtractedResultsPage() {
pitchBookId={pitchBook} pitchBookId={pitchBook}
currentPage={currentPage} currentPage={currentPage}
onPageChange={setCurrentPage} onPageChange={setCurrentPage}
highlight={Object.values(kpi)
.map((item) => item.at(0))
.map((item) => ({
page: item?.page || -1,
text: item?.entity || "",
}))}
focusHighlight={focusHighlight}
/> />
</Paper> </Paper>
<Box <Box

View File

@ -1,10 +1,6 @@
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import { import {
Box, Box,
Button, Button, Dialog, DialogActions, DialogContent,
Dialog,
DialogActions,
DialogContent,
DialogContentText, DialogContentText,
DialogTitle, DialogTitle,
IconButton, IconButton,
@ -18,18 +14,15 @@ import {
TableHead, TableHead,
TableRow, TableRow,
TextField, TextField,
Typography, Typography
} from "@mui/material"; } from "@mui/material";
import { import {useMutation, useQueryClient, useSuspenseQuery} from "@tanstack/react-query";
useMutation,
useQueryClient,
useSuspenseQuery,
} from "@tanstack/react-query";
import { createFileRoute, useNavigate } from "@tanstack/react-router"; import { createFileRoute, useNavigate } from "@tanstack/react-router";
import {useEffect, useState} from "react"; import {useEffect, useState} from "react";
import PDFViewer from "../components/pdfViewer"; import PDFViewer from "../components/pdfViewer";
import { fetchPutKPI } from "../util/api";
import { kpiQueryOptions } from "../util/query"; import { kpiQueryOptions } from "../util/query";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import {fetchPutKPI} from "../util/api";
import { redirect } from "@tanstack/react-router"; import { redirect } from "@tanstack/react-router";
export const Route = createFileRoute("/extractedResult_/$pitchBook/$kpi")({ export const Route = createFileRoute("/extractedResult_/$pitchBook/$kpi")({
@ -57,17 +50,18 @@ function ExtractedResultsPage() {
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const { from } = Route.useSearch(); const { from } = Route.useSearch();
const { data: kpiData } = useSuspenseQuery(kpiQueryOptions(pitchBook)); const {
data: kpiData
} = useSuspenseQuery(kpiQueryOptions(pitchBook));
const kpiValues = kpiData[kpi.toUpperCase()] || []; const kpiValues = kpiData[kpi.toUpperCase()] || [];
const [selectedIndex, setSelectedIndex] = useState(0); const [selectedIndex, setSelectedIndex] = useState(0);
const [currentPage, setCurrentPage] = useState(kpiValues[0]?.page || 1); const [currentPage, setCurrentPage] = useState(kpiValues[0]?.page || 1);
const [showConfirmDialog, setShowConfirmDialog] = useState(false); const [showConfirmDialog, setShowConfirmDialog] = useState(false);
const [hasChanges, setHasChanges] = useState(false); const [hasChanges, setHasChanges] = useState(false);
const [customValue, setCustomValue] = useState(""); const [customValue, setCustomValue] = useState('');
const originalValue = kpiValues[0]?.entity || ""; const originalValue = kpiValues[0]?.entity || '';
const selectedValue = const selectedValue = selectedIndex === -1 ? customValue : (kpiValues[selectedIndex]?.entity || '');
selectedIndex === -1 ? customValue : kpiValues[selectedIndex]?.entity || "";
useEffect(() => { useEffect(() => {
setHasChanges(selectedValue !== originalValue); setHasChanges(selectedValue !== originalValue);
@ -76,24 +70,10 @@ function ExtractedResultsPage() {
const { mutate: updateKPI } = useMutation({ const { mutate: updateKPI } = useMutation({
mutationFn: () => { mutationFn: () => {
const updatedData = { ...kpiData }; const updatedData = { ...kpiData };
let baseObject; updatedData[kpi.toUpperCase()] = [{
if (selectedIndex >= 0) { ...kpiValues[0],
baseObject = kpiValues[selectedIndex]; entity: selectedValue
} else { }];
baseObject = {
label: kpi.toUpperCase(),
entity: selectedValue,
page: 0,
status: "single-source",
source: "manual",
};
}
updatedData[kpi.toUpperCase()] = [
{
...baseObject,
entity: selectedValue,
},
];
return fetchPutKPI(Number(pitchBook), updatedData); return fetchPutKPI(Number(pitchBook), updatedData);
}, },
onSuccess: () => { onSuccess: () => {
@ -107,34 +87,30 @@ function ExtractedResultsPage() {
}); });
}, },
onError: (error) => { onError: (error) => {
console.error("Error updating KPI:", error); console.error('Error updating KPI:', error);
}, }
}); });
const handleRadioChange = (event: React.ChangeEvent<HTMLInputElement>) => { const handleRadioChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const value = event.target.value; const value = event.target.value;
if (value === "custom") { if (value === 'custom') {
setSelectedIndex(-1); setSelectedIndex(-1);
} else { } else {
const index = Number.parseInt(value); const index = parseInt(value);
setSelectedIndex(index); setSelectedIndex(index);
setCurrentPage(kpiValues[index].page); setCustomValue('');
setCustomValue("");
} }
}; };
const handleCustomValueChange = ( const handleCustomValueChange = (event: React.ChangeEvent<HTMLInputElement>) => {
event: React.ChangeEvent<HTMLInputElement>,
) => {
const value = event.target.value; const value = event.target.value;
setCustomValue(value); setCustomValue(value);
setSelectedIndex(-1); setSelectedIndex(-1);
}; };
const handleRowClick = (index: number) => { const handleRowClick = (index: number) => {
setCurrentPage(kpiValues[index].page);
setSelectedIndex(index); setSelectedIndex(index);
setCustomValue(""); setCustomValue('');
}; };
const handleBackClick = () => { const handleBackClick = () => {
@ -168,9 +144,9 @@ function ExtractedResultsPage() {
return ( return (
<Box p={4}> <Box p={4}>
<Box sx={{ display: "flex", alignItems: "center", mb: 3 }}> <Box sx={{ display: 'flex', alignItems: 'center', mb: 3 }}>
<IconButton onClick={handleBackClick} sx={{ mr: 2 }}> <IconButton onClick={handleBackClick} sx={{ mr: 2 }}>
<ArrowBackIcon fontSize="large" sx={{ color: "#383838" }} /> <ArrowBackIcon fontSize="large" sx={{ color: '#383838' }} />
</IconButton> </IconButton>
<Typography variant="h5" fontWeight="bold"> <Typography variant="h5" fontWeight="bold">
Überprüfung der Kennzahl: {kpi} Überprüfung der Kennzahl: {kpi}
@ -216,8 +192,8 @@ function ExtractedResultsPage() {
<TableRow <TableRow
key={`${item.entity}_${item.page}_${index}`} key={`${item.entity}_${item.page}_${index}`}
sx={{ sx={{
"&:hover": { backgroundColor: "#f9f9f9" }, '&:hover': { backgroundColor: '#f9f9f9' },
cursor: "pointer", cursor: 'pointer'
}} }}
onClick={() => handleRowClick(index)} onClick={() => handleRowClick(index)}
> >
@ -225,14 +201,14 @@ function ExtractedResultsPage() {
<Box <Box
sx={{ sx={{
borderRadius: 1, borderRadius: 1,
padding: "4px 8px", padding: '4px 8px',
display: "flex", display: 'flex',
alignItems: "center", alignItems: 'center',
width: "100%", width: '100%',
cursor: "pointer", cursor: 'pointer',
"&:hover": { '&:hover': {
borderColor: "#ccc", borderColor: '#ccc'
}, }
}} }}
> >
<Radio <Radio
@ -240,13 +216,13 @@ function ExtractedResultsPage() {
checked={selectedIndex === index} checked={selectedIndex === index}
onChange={handleRadioChange} onChange={handleRadioChange}
sx={{ sx={{
color: "#383838", color: '#383838',
"&.Mui-checked": { color: "#383838" }, '&.Mui-checked': { color: '#383838' },
padding: "4px", padding: '4px',
marginRight: 1, marginRight: 1,
"&:focus": { '&:focus': {
outline: "none", outline: 'none'
}, }
}} }}
/> />
<span>{item.entity}</span> <span>{item.entity}</span>
@ -259,7 +235,7 @@ function ExtractedResultsPage() {
e.stopPropagation(); e.stopPropagation();
setCurrentPage(item.page); setCurrentPage(item.page);
}} }}
sx={{ cursor: "pointer" }} sx={{ cursor: 'pointer' }}
> >
{item.page} {item.page}
</Link> </Link>
@ -271,14 +247,14 @@ function ExtractedResultsPage() {
<TableCell> <TableCell>
<Box <Box
sx={{ sx={{
padding: "4px 8px", padding: '4px 8px',
display: "flex", display: 'flex',
alignItems: "center", alignItems: 'center',
width: "100%", width: '100%',
cursor: "pointer", cursor: 'pointer',
"&:hover": { '&:hover': {
borderColor: "#ccc", borderColor: '#ccc'
}, }
}} }}
onClick={() => { onClick={() => {
setSelectedIndex(-1); setSelectedIndex(-1);
@ -286,16 +262,16 @@ function ExtractedResultsPage() {
> >
<Radio <Radio
value="custom" value="custom"
checked={selectedIndex === -1 && customValue !== ""} checked={selectedIndex === -1 && customValue !== ''}
onChange={handleRadioChange} onChange={handleRadioChange}
sx={{ sx={{
color: "#383838", color: '#383838',
"&.Mui-checked": { color: "#383838" }, '&.Mui-checked': { color: '#383838' },
padding: "4px", padding: '4px',
marginRight: 1, marginRight: 1,
"&:focus": { '&:focus': {
outline: "none", outline: 'none'
}, }
}} }}
/> />
<TextField <TextField
@ -308,9 +284,9 @@ function ExtractedResultsPage() {
disableUnderline: true, disableUnderline: true,
}} }}
sx={{ sx={{
"& .MuiInput-input": { '& .MuiInput-input': {
padding: 0, padding: 0,
}, }
}} }}
onClick={(e: React.MouseEvent) => { onClick={(e: React.MouseEvent) => {
e.stopPropagation(); e.stopPropagation();
@ -341,20 +317,13 @@ function ExtractedResultsPage() {
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
overflow: "auto", overflow: "auto",
padding: 2, padding: 2
}} }}
> >
<PDFViewer <PDFViewer
pitchBookId={pitchBook} pitchBookId={pitchBook}
currentPage={currentPage} currentPage={currentPage}
onPageChange={setCurrentPage} onPageChange={setCurrentPage}
highlight={Object.values(kpiValues)
.flat()
.map((k) => ({ page: k.page, text: k.entity }))}
focusHighlight={{
page: kpiValues.at(selectedIndex)?.page || -1,
text: kpiValues.at(selectedIndex)?.entity || "",
}}
/> />
</Paper> </Paper>
<Box mt={2} display="flex" justifyContent="flex-end" gap={2}> <Box mt={2} display="flex" justifyContent="flex-end" gap={2}>
@ -363,9 +332,9 @@ function ExtractedResultsPage() {
onClick={handleAcceptReview} onClick={handleAcceptReview}
disabled={!selectedValue} disabled={!selectedValue}
sx={{ sx={{
backgroundColor: "#383838", backgroundColor: '#383838',
"&:hover": { backgroundColor: "#2e2e2e" }, '&:hover': { backgroundColor: '#2e2e2e' },
"&.Mui-disabled": { backgroundColor: "#ccc" }, '&.Mui-disabled': { backgroundColor: '#ccc' }
}} }}
> >
Überprüfung Annehmen Überprüfung Annehmen
@ -380,11 +349,11 @@ function ExtractedResultsPage() {
maxWidth="sm" maxWidth="sm"
fullWidth fullWidth
> >
<DialogTitle sx={{ fontSize: "1.25rem", fontWeight: "bold" }}> <DialogTitle sx={{ fontSize: '1.25rem', fontWeight: 'bold' }}>
Achtung Achtung
</DialogTitle> </DialogTitle>
<DialogContent> <DialogContent>
<DialogContentText sx={{ fontSize: "1rem" }}> <DialogContentText sx={{ fontSize: '1rem' }}>
Alle vorgenommenen Änderungen werden verworfen. Alle vorgenommenen Änderungen werden verworfen.
</DialogContentText> </DialogContentText>
</DialogContent> </DialogContent>
@ -393,9 +362,9 @@ function ExtractedResultsPage() {
onClick={handleCancelDiscard} onClick={handleCancelDiscard}
variant="outlined" variant="outlined"
sx={{ sx={{
color: "#666", color: '#666',
borderColor: "#ddd", borderColor: '#ddd',
"&:hover": { backgroundColor: "#f5f5f5" }, '&:hover': { backgroundColor: '#f5f5f5' }
}} }}
> >
Abbrechen Abbrechen
@ -404,8 +373,8 @@ function ExtractedResultsPage() {
onClick={handleConfirmDiscard} onClick={handleConfirmDiscard}
variant="contained" variant="contained"
sx={{ sx={{
backgroundColor: "#383838", backgroundColor: '#383838',
"&:hover": { backgroundColor: "#2e2e2e" }, '&:hover': { backgroundColor: '#2e2e2e' }
}} }}
> >
Bestätigen Bestätigen

View File

@ -1,12 +0,0 @@
export const highlightPattern = (
text: string,
widthHeight: string,
pos: string[],
posFocus: string[],
) => {
if (posFocus.includes(widthHeight)) {
return `<mark style="background-color: orange;">${text}</mark>`;
}
return pos.includes(widthHeight) ? `<mark>${text}</mark>` : text;
};