mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-25 12:05:06 +02:00
- Add explicit type="button" to 61 <button> elements missing the attribute - Replace useContext() with React 19 use() across 16 context consumers - Replace [...arr].sort() with arr.toSorted() in 12 web/desktop files (mobile excluded — Hermes lacks toSorted support) - Fix rules-of-hooks violation: useSidebar try/catch → useSidebarSafe null check - Fix nested component definition: useMemo wrapping HeaderRight → useCallback - Fix missing ARIA: add aria-expanded + aria-controls to combobox in create-squad React Doctor score: 23 → 30. No behavioral changes, no business logic modified. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
25 lines
617 B
TypeScript
25 lines
617 B
TypeScript
"use client";
|
|
|
|
import { cn } from "@multica/ui/lib/utils";
|
|
import { SidebarTrigger, useSidebarSafe } from "@multica/ui/components/ui/sidebar";
|
|
|
|
function MobileSidebarTrigger() {
|
|
const sidebar = useSidebarSafe();
|
|
if (!sidebar) return null;
|
|
return <SidebarTrigger className="mr-2 md:hidden" />;
|
|
}
|
|
|
|
interface PageHeaderProps {
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
}
|
|
|
|
export function PageHeader({ children, className }: PageHeaderProps) {
|
|
return (
|
|
<div className={cn("flex h-12 shrink-0 items-center border-b px-4", className)}>
|
|
<MobileSidebarTrigger />
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|