import { WORKBENCH_LAYOUT } from "../layout/workbench-layout";

export type MobileWorkbenchSheetSnap = "half" | "full";

export function getMobileWorkbenchSheetHeight(
  snap: MobileWorkbenchSheetSnap,
  viewportHeight: number
) {
  if (snap === "half") {
    return Math.round(viewportHeight * WORKBENCH_LAYOUT.mobileSheet.halfViewportRatio);
  }

  return Math.max(
    Math.round(viewportHeight * WORKBENCH_LAYOUT.mobileSheet.halfViewportRatio),
    viewportHeight - WORKBENCH_LAYOUT.mobileSheet.fullTopGap
  );
}
