"use client";
import Box from "@mui/material/Box";
import type { ReactNode } from "react";
import type { WorkbenchGridRegionId } from "@/components/PoWorkbench/mock/workbenchMockData";
export interface PoWorkbenchRegionProps {
/** Which pane to render; must match {@link WorkbenchGridRegionId}. */
region: WorkbenchGridRegionId;
children?: ReactNode;
}
const basePaneSx = {
minWidth: 0,
minHeight: 0,
height: "100%",
display: "flex",
flexDirection: "column" as const,
border: 1,
borderColor: "divider",
bgcolor: "background.paper",
boxSizing: "border-box" as const,
};
/**
* One scrollable pane in the PO Workbench grid.
*
* Right-column panes (`detailsHeader`, `details`) use an outer rounded wrapper with
* `overflow: hidden` so `borderTopRightRadius` / `borderBottomRightRadius` stay visible;
* scroll lives on an inner box.
*
* @remarks
* The root sets `data-workbench-region` to the `region` value for automated tests and debugging.
* Values are stable and correspond to {@link WorkbenchGridRegionId}.
*/
export default function PoWorkbenchRegion({
region,
children,
}: PoWorkbenchRegionProps) {
const isDetailsHeader = region === "detailsHeader";
const isDetailsBody = region === "details";
const useRoundedRightShell = isDetailsHeader || isDetailsBody;
if (useRoundedRightShell) {
return (
{children}
);
}
return (
{children}
);
}