"use client"; import { Check, ChevronsUpDown, Layers } from "lucide-react"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { useViewStore } from "@/lib/stores/view-store"; import { cn } from "@/lib/utils"; const GROUP_OPTIONS: { label: string; value: string | null }[] = [ { label: "None", value: null }, { label: "Status", value: "status" }, { label: "Type", value: "type" }, { label: "Priority", value: "priority" }, { label: "Assignee", value: "assignee" }, ]; function labelForValue(value: string | null): string { return GROUP_OPTIONS.find((o) => o.value === value)?.label ?? "None"; } export function GroupConfig() { const groupBy = useViewStore((s) => s.config.groupBy); const setGroupBy = useViewStore((s) => s.setGroupBy); const selectedLabel = labelForValue(groupBy); return ( {GROUP_OPTIONS.map((opt) => ( setGroupBy(opt.value)} > {opt.label} ))} ); }