Files
route-commerce/src/components/admin/AdminShell.tsx
T
Tyler 837f7f83cb fix(admin): AdminShell brands type must include logo_url (AdminSidebar requires it)
The plan's AdminShell type for the brands prop was missing the
logo_url field that AdminSidebar requires. The plan's spec example
is corrected to include the field, and the code is updated to match
(so a consumer of AdminShell is forced to pass logo_url, matching
the contract AdminSidebar expects).

Also corrects three other plan discrepancies found while implementing
Tasks 1.7-1.12:
- Task 1.12: existing EmptyState.tsx is in active use; reuse it
  instead of creating a duplicate.
- Task 1.12: CardList.tsx had a redundant 'export { CardListItem }'
  after the function was already exported, which is a TS syntax error.
  Removed the redundant line.
- Plan narrative now reflects all three corrections.

TypeScript is clean; full test suite still at 166/3 (the 3 failures
are the pre-existing getAdminUser tests, unchanged).
2026-06-17 14:25:16 -06:00

56 lines
1.4 KiB
TypeScript

import { ReactNode } from "react";
import AdminSidebar from "@/components/admin/AdminSidebar";
import MobileTabBar from "@/components/admin/MobileTabBar";
import OfflineBanner from "@/components/admin/OfflineBanner";
import { useMediaQuery } from "@/lib/use-media-query"; // see Task 1.9
interface AdminShellProps {
userRole: string | null;
brandIds?: string[];
activeBrandId?: string | null;
brands: { id: string; name: string; slug: string; logo_url: string | null }[];
enabledAddons?: Record<string, boolean>;
children: ReactNode;
}
export function AdminShell(props: AdminShellProps) {
const isDesktop = useMediaQuery("(min-width: 1024px)");
if (isDesktop) {
return (
<>
<AdminSidebar
userRole={props.userRole}
brandIds={props.brandIds}
activeBrandId={props.activeBrandId}
brands={props.brands}
enabledAddons={props.enabledAddons}
/>
<div
id="page-content"
className="min-h-screen lg:pl-60 outline-none"
style={{ backgroundColor: "var(--color-surface)" }}
>
{props.children}
</div>
</>
);
}
return (
<>
<OfflineBanner />
<div
id="page-content"
className="min-h-screen pb-20 outline-none"
style={{ backgroundColor: "var(--color-surface)" }}
>
{props.children}
</div>
<MobileTabBar />
</>
);
}
export default AdminShell;