From 112837b20eab01283b70223c2f7e75154907793d Mon Sep 17 00:00:00 2001 From: frontend perkafean <165241731+frontendperkafean@users.noreply.github.com> Date: Sun, 8 Sep 2024 06:48:45 +0000 Subject: [PATCH] ok --- src/pages/Reports.js | 109 +++++++++++++++++++++++++++++++------------ 1 file changed, 80 insertions(+), 29 deletions(-) diff --git a/src/pages/Reports.js b/src/pages/Reports.js index facfc5c..14439cf 100644 --- a/src/pages/Reports.js +++ b/src/pages/Reports.js @@ -19,14 +19,15 @@ const RoundedRectangle = ({ percentage, fontSize = "15px", loading = false, + children, // Assuming this is a React component or JSX + isChildren, }) => { const containerStyle = { display: "flex", flexDirection: "column", alignItems: "flex-start", justifyContent: "center", - width: "calc(100% / 2 - 10px)", - maxWidth: "250px", + width: !children && !isChildren && "calc(100% / 2 - 10px)", height: "auto", borderRadius: "15px", padding: "20px", @@ -41,7 +42,9 @@ const RoundedRectangle = ({ fontWeight: "bold", marginBottom: "10px", width: "100%", - backgroundColor: loading ? "rgb(85 85 85)" : "inherit", + backgroundColor: loading + ? "rgb(85 85 85)" + : !isChildren && !children && "inherit", color: loading ? "transparent" : "inherit", }; @@ -61,8 +64,8 @@ const RoundedRectangle = ({ color: loading ? "transparent" : "inherit", backgroundColor: loading ? "rgb(85 85 85)" : "transparent", overflow: "hidden", - textOverflow: "ellipsis", // Add ellipsis for overflow text - whiteSpace: "nowrap", // Prevent text from wrapping + textOverflow: "ellipsis", + whiteSpace: "nowrap", }; const percentageStyle = { @@ -80,22 +83,21 @@ const RoundedRectangle = ({ return (