multica/apps/web/app/(dashboard)/_components/tab-link.tsx
Naiyuan Qing 6185b7571e refactor(web): extract shared components, add tab system, and restructure issues page
- Extract AppSidebar, TabBar, TabLink into dashboard _components
- Add tab-store for browser-like tab navigation state
- Move StatusIcon/PriorityIcon to issues/_components, config to _config
- Replace inline CreateIssueForm with Dialog (status/priority selection)
- Add calendar component to packages/ui
- Simplify dashboard layout with SidebarProvider

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 20:19:59 +08:00

30 lines
606 B
TypeScript

"use client";
import Link from "next/link";
import { useTabStore } from "../../../lib/tab-store";
export function TabLink({
href,
title,
iconKey,
children,
...props
}: {
href: string;
title: string;
iconKey?: string;
children: React.ReactNode;
} & Omit<React.ComponentProps<typeof Link>, "onClick" | "href">) {
const { openTab } = useTabStore();
const handleClick = (e: React.MouseEvent) => {
e.preventDefault();
openTab(href, title, { replace: false, iconKey });
};
return (
<Link href={href} onClick={handleClick} {...props}>
{children}
</Link>
);
}