diff --git a/client/src/containers/header/index.tsx b/client/src/containers/header/index.tsx index a7c1b4f1..004dad5d 100644 --- a/client/src/containers/header/index.tsx +++ b/client/src/containers/header/index.tsx @@ -2,6 +2,8 @@ import { FC, useState } from "react"; +import Link from "next/link"; + import { Menu as MenuIcon } from "lucide-react"; import { Overlay } from "@/components/ui/overlay"; @@ -12,7 +14,6 @@ import { } from "@/components/ui/popover"; import Menu from "./menu"; -import Link from "next/link"; const Header: FC = () => { const [isOpen, setIsOpen] = useState(false); diff --git a/client/src/containers/header/menu/index.tsx b/client/src/containers/header/menu/index.tsx index 480f5c26..1b4c13ff 100644 --- a/client/src/containers/header/menu/index.tsx +++ b/client/src/containers/header/menu/index.tsx @@ -1,9 +1,9 @@ import { FC } from "react"; import Link from "next/link"; +import { usePathname } from "next/navigation"; import UserMenu from "./user"; -import { usePathname } from "next/navigation"; export const classes = { link: "block px-4 py-2 hover:bg-muted transition-colors", diff --git a/client/src/containers/widget/index.tsx b/client/src/containers/widget/index.tsx index 014873a5..566194f8 100644 --- a/client/src/containers/widget/index.tsx +++ b/client/src/containers/widget/index.tsx @@ -149,12 +149,7 @@ export default function Widget({ className, )} > - + ); diff --git a/client/src/containers/widget/widget-header/index.tsx b/client/src/containers/widget/widget-header/index.tsx index a53b8fbc..b1c3dc7e 100644 --- a/client/src/containers/widget/widget-header/index.tsx +++ b/client/src/containers/widget/widget-header/index.tsx @@ -33,26 +33,27 @@ const WidgetHeader: FC = ({ {indicator} -
- - - -

- - {responseRate}% -

-
- -

Response rate

-
-
-
- - {menu} -
+ {typeof responseRate === "number" && ( +
+ + + +

+ + {responseRate}% +

+
+ +

Response rate

+
+
+
+
+ )} + {menu} {question &&

{question}

} diff --git a/client/src/lib/normalize-widget-data.ts b/client/src/lib/normalize-widget-data.ts index d6f35d50..766fd2fc 100644 --- a/client/src/lib/normalize-widget-data.ts +++ b/client/src/lib/normalize-widget-data.ts @@ -19,10 +19,12 @@ function normalizeWidgetData(widgetData: WidgetData): WidgetData { } if (result.breakdown) { - result.breakdown = result.breakdown.map((b) => ({ - ...b, - data: normalizeChartData(b.data), - })); + result.breakdown = result.breakdown + .map((b) => ({ + ...b, + data: normalizeChartData(b.data), + })) + .filter((d) => d.label !== "N/A"); } return result;