import type { CSSProperties } from 'react';

export type SceneOverlayViewport = {
  x: number;
  y: number;
  w: number;
  h: number;
};

export function overlayRootStyle(viewport: SceneOverlayViewport | null | undefined): CSSProperties | undefined {
  if (!viewport || viewport.w <= 0 || viewport.h <= 0) return undefined;
  return {
    left: viewport.x,
    top: viewport.y,
    width: viewport.w,
    height: viewport.h,
    right: 'auto',
    bottom: 'auto',
    overflow: 'hidden',
  };
}
