aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorMax Nanis2025-06-06 22:40:41 +0700
committerMax Nanis2025-06-06 22:40:41 +0700
commit257bc2f85b71a8564e95a8e6ba39ab0b00e022df (patch)
treec44ced82b5f5f99e7e7bb9cffcd444a41b8a648c /src/components
parent696dee6a6a9506fcf771d0ec4911dcc82a279fda (diff)
downloadpanel-ui-257bc2f85b71a8564e95a8e6ba39ab0b00e022df.tar.gz
panel-ui-257bc2f85b71a8564e95a8e6ba39ab0b00e022df.zip
Question.active state (clear naming on getInitialQuestion and getNextQuestion). Explicit use of return null as an option for answerSlice. Saving motion. Questions rolling window. Question count badge to sidebar.
Diffstat (limited to 'src/components')
-rw-r--r--src/components/nav-main.tsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/components/nav-main.tsx b/src/components/nav-main.tsx
index 12a60aa..34fa5a8 100644
--- a/src/components/nav-main.tsx
+++ b/src/components/nav-main.tsx
@@ -10,10 +10,15 @@ import {
} from "@/components/ui/sidebar"
import {setPage} from "@/models/appSlice.ts";
import {useAppDispatch} from "@/hooks.ts";
+import {useSelector} from "react-redux";
+import {selectQuestions} from "@/models/questionSlice.ts";
+import {Badge} from "@/components/ui/badge"
export function NavMain() {
const dispatch = useAppDispatch()
+ const questions = useSelector(selectQuestions)
+
return (
<SidebarGroup>
<SidebarGroupContent className="flex flex-col gap-2">
@@ -34,7 +39,13 @@ export function NavMain() {
>
<SidebarMenuButton tooltip="Questions">
<ListIcon/>
- <span>Questions</span>
+ <span>
+ Questions <Badge
+ className="absolute top-2 right-2 h-5 min-w-5 rounded-full px-1 font-mono tabular-nums cursor-pointer"
+ variant="outline"
+ title={`${questions.length.toLocaleString()} profiling question available`}
+ >{questions.length.toLocaleString()}</Badge>
+ </span>
</SidebarMenuButton>
</SidebarMenuItem>