peppa/apps/web/components/Workspace.tsx
Асель 28fbde4add PEP-38: console foundation — Tailwind v4, shadcn/ui components, dark theme, three-panel layout
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 16:21:43 +05:00

28 lines
1.1 KiB
TypeScript

import type { ReactNode } from "react";
import { ActivityAside } from "@/components/ActivityAside";
import { Footer } from "@/components/Footer";
/**
* Centre + right panel of the console (PEP-38). The page decides what the right panel shows;
* without `aside` it gets the default activity panel, `aside={null}` hides it.
* Below xl the panel goes under the page content, the footer is always last.
*/
export function Workspace({ children, aside }: { children: ReactNode; aside?: ReactNode }) {
const panel = aside === undefined ? <ActivityAside /> : aside;
return (
<div className="grid flex-1 xl:grid-cols-[minmax(0,1fr)_360px] xl:grid-rows-[1fr_auto]">
<main className="min-w-0 px-4 py-5 md:px-8 md:py-7">
<div className="mx-auto w-full max-w-5xl">{children}</div>
</main>
{panel && (
<aside aria-label="Панель" className="min-w-0 border-t bg-sidebar/60 px-4 py-5 xl:sticky xl:top-0 xl:col-start-2 xl:row-span-2 xl:row-start-1 xl:h-dvh xl:overflow-y-auto xl:border-t-0 xl:border-l">
{panel}
</aside>
)}
<div className="xl:col-start-1">
<Footer />
</div>
</div>
);
}