peppa/apps/web/components/Workspace.tsx
Асель 52d861bbc7 UI: board in one row, project panel moved into a ⋯ settings dialog
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 22:52:53 +05:00

30 lines
1.5 KiB
TypeScript

import type { ReactNode } from "react";
import { ActivityAside } from "@/components/ActivityAside";
import { Footer } from "@/components/Footer";
import { cn } from "@/lib/utils";
/**
* 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.
* `wide` lets the centre grow past the reading width (the board page, with its panel moved into a dialog).
* Below xl the panel goes under the page content (`asideWideOnly`: shown on xl only), the footer is always last.
*/
export function Workspace({ children, aside, asideWideOnly = false, wide = false }: { children: ReactNode; aside?: ReactNode; asideWideOnly?: boolean; wide?: boolean }) {
const panel = aside === undefined ? <ActivityAside /> : aside;
return (
<div className={cn("grid flex-1", panel && "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={cn("mx-auto w-full", wide ? "max-w-[1600px]" : "max-w-5xl")}>{children}</div>
</main>
{panel && (
<aside aria-label="Панель" className={cn(asideWideOnly && "max-xl:hidden", "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>
);
}