Skip to content

Commit

Permalink
#453 show results by default
Browse files Browse the repository at this point in the history
  • Loading branch information
AFPMedialab committed May 16, 2024
1 parent ff467a0 commit 9daea53
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,16 @@ const SyntheticImageDetectionResults = (props) => {
const floor = Math.floor(percentage);
return floor === 0 ? 1 : floor;
};
const [detailsPanelMessage, setDetailsPanelMessage] = useState(
"synthetic_image_detection_additional_results_hide",
);
const handleDetailsChange = () => {
detailsPanelMessage === "synthetic_image_detection_additional_results_hide"
? setDetailsPanelMessage("synthetic_image_detection_additional_results")
: setDetailsPanelMessage(
"synthetic_image_detection_additional_results_hide",
);
};

return (
<Stack
Expand Down Expand Up @@ -350,13 +360,9 @@ const SyntheticImageDetectionResults = (props) => {
</Alert>
)}
<Box sx={{ width: "100%" }}>
<Accordion>
<Accordion defaultExpanded onChange={handleDetailsChange}>
<AccordionSummary expandIcon={<ExpandMore />}>
<Typography>
{keyword(
"synthetic_image_detection_additional_results",
)}
</Typography>
<Typography>{keyword(detailsPanelMessage)}</Typography>
</AccordionSummary>
<AccordionDetails>
<Stack direction={"column"} spacing={4}>
Expand Down

0 comments on commit 9daea53

Please sign in to comment.