#32-fehlende-Kennzahl #70

Merged
3019483 merged 3 commits from #32-fehlende-Kennzahl into main 2025-06-15 15:17:50 +02:00
1 changed files with 67 additions and 53 deletions

View File

@ -225,61 +225,75 @@ export default function KennzahlenTable({
</Box> </Box>
</Tooltip> </Tooltip>
) : ( ) : (
<Box <Tooltip
sx={{ title={hasNoValue ?
border: `2px solid ${borderColor}`, <>
borderRadius: 1, <b>Problem</b>
padding: "4px 8px", <br />
display: "flex", Es wurden keine Kennzahlen gefunden. Bitte ergänzen!
alignItems: "center", </> : ""
justifyContent: "space-between", }
width: "100%", placement="bottom"
cursor: "text", arrow
}}
> >
<Box <span>
sx={{ <Box
display: "flex", sx={{
alignItems: "center", border: `2px solid ${borderColor}`,
gap: 1, borderRadius: 1,
width: "100%", padding: "4px 8px",
}} display: "flex",
> alignItems: "center",
{hasNoValue && ( justifyContent: "space-between",
<ErrorOutlineIcon fontSize="small" color="error" /> width: "100%",
)} cursor: "text",
{editingIndex === row.setting.name ? ( }}
<TextField >
value={editValue} <Box
onChange={(e) => setEditValue(e.target.value)} sx={{
onKeyDown={(e) => display: "flex",
handleKeyPress(e, row.setting.name) alignItems: "center",
} gap: 1,
onBlur={() => handleSave(row.setting.name)} width: "100%",
autoFocus }}
size="small" >
fullWidth {hasNoValue && (
variant="standard" <ErrorOutlineIcon fontSize="small" color="error" />
sx={{ margin: "-8px 0" }} )}
{editingIndex === row.setting.name ? (
<TextField
value={editValue}
onChange={(e) => setEditValue(e.target.value)}
onKeyDown={(e) =>
handleKeyPress(e, row.setting.name)
}
onBlur={() => handleSave(row.setting.name)}
autoFocus
size="small"
fullWidth
variant="standard"
sx={{ margin: "-8px 0" }}
/>
) : (
<span>
{row.extractedValues.at(0)?.entity || "—"}
</span>
)}
</Box>
<EditIcon
fontSize="small"
sx={{ color: "#555", cursor: "pointer" }}
onClick={(e) => {
e.stopPropagation();
startEditing(
row.extractedValues.at(0)?.entity || "",
row.setting.name,
);
}}
/> />
) : ( </Box>
<span> </span>
{row.extractedValues.at(0)?.entity || "—"} </Tooltip>
</span>
)}
</Box>
<EditIcon
fontSize="small"
sx={{ color: "#555", cursor: "pointer" }}
onClick={(e) => {
e.stopPropagation();
startEditing(
row.extractedValues.at(0)?.entity || "",
row.setting.name,
);
}}
/>
</Box>
)} )}
</TableCell> </TableCell>
<TableCell align="center"> <TableCell align="center">