"use client"; import * as Tabs from "@radix-ui/react-tabs"; import { LayoutGrid, List, Table2 } from "lucide-react"; import { cn } from "@/lib/utils"; import { type ActiveViewType, useViewStore } from "@/lib/stores/view-store"; const tabs: { id: ActiveViewType; label: string; icon: typeof List }[] = [ { id: "list", label: "List", icon: List }, { id: "board", label: "Board", icon: LayoutGrid }, { id: "table", label: "Table", icon: Table2 }, ]; export function ViewSwitcher() { const activeView = useViewStore((s) => s.activeView); const setActiveView = useViewStore((s) => s.setActiveView); const tabValue = tabs.some((t) => t.id === activeView) ? activeView : "list"; return ( setActiveView(v as ActiveViewType)}> {tabs.map(({ id, label, icon: Icon }) => ( {label} ))} ); }