- Add actor_type/actor_id to inbox items for proper attribution - Extract issue detail into features/issues/components/issue-detail.tsx - Inbox page and store updates for actor-based notifications - Sidebar, layout, and actor-avatar refinements Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
import { useRouter, usePathname } from "next/navigation";
|
|
import { MulticaIcon } from "@/components/multica-icon";
|
|
import { useNavigationStore } from "@/features/navigation";
|
|
import { SidebarProvider, SidebarInset } from "@/components/ui/sidebar";
|
|
import { useAuthStore } from "@/features/auth";
|
|
import { useWorkspaceStore } from "@/features/workspace";
|
|
import { AppSidebar } from "./_components/app-sidebar";
|
|
|
|
export default function DashboardLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const router = useRouter();
|
|
const pathname = usePathname();
|
|
const user = useAuthStore((s) => s.user);
|
|
const isLoading = useAuthStore((s) => s.isLoading);
|
|
const workspace = useWorkspaceStore((s) => s.workspace);
|
|
|
|
useEffect(() => {
|
|
if (!isLoading && !user) {
|
|
router.push("/login");
|
|
}
|
|
}, [user, isLoading, router]);
|
|
|
|
useEffect(() => {
|
|
useNavigationStore.getState().onPathChange(pathname);
|
|
}, [pathname]);
|
|
|
|
if (isLoading) {
|
|
return (
|
|
<div className="flex h-screen items-center justify-center">
|
|
<MulticaIcon className="size-6" />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
if (!user || !workspace) return null;
|
|
|
|
return (
|
|
<SidebarProvider className="h-svh">
|
|
<AppSidebar />
|
|
<SidebarInset className="overflow-hidden">{children}</SidebarInset>
|
|
</SidebarProvider>
|
|
);
|
|
}
|