Task 25: Multiple dashboards — dashboards table + migration, /d/[slug] route, root redirect, dashboard tabs in nav with create/rename/delete/ set-default. Task 26: Editable dashboard — react-grid-layout drag/resize editor, widget picker modal with per-widget configurator auto-generated from default config, save/reset server actions with Zod validation. Completion visibility: server-side per-user setting (hours) replaces localStorage timer; queries filter completed items by updatedAt cutoff; Settings page dropdown persists preference via server action. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
602 B
TypeScript
23 lines
602 B
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { usePathname } from "next/navigation";
|
|
|
|
export function DashboardTab({ slug, name }: { slug: string; name: string }) {
|
|
const pathname = usePathname();
|
|
const isActive = pathname === `/d/${slug}` || pathname.startsWith(`/d/${slug}/`);
|
|
|
|
return (
|
|
<Link
|
|
href={`/d/${slug}`}
|
|
className={`shrink-0 px-3 py-2 text-sm transition-colors border-b-2 ${
|
|
isActive
|
|
? "border-primary text-foreground"
|
|
: "border-transparent text-muted-foreground hover:text-foreground"
|
|
}`}
|
|
>
|
|
{name}
|
|
</Link>
|
|
);
|
|
}
|