Files
MultiRoombaRover/webui/src/mini/MiniSummaryApp/components/FitViewportFrame.jsx
T
2026-04-28 19:39:13 -04:00

22 lines
853 B
React

// Fit Viewport Frame
// Purpose: Defines the Fit Viewport Frame module and the local helpers/components used in this file.
// Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit.
export default function FitViewportFrame({ children }) {
return (
<div className="flex h-full w-full items-center justify-start overflow-hidden bg-black">
<div
className="relative flex items-center justify-center overflow-hidden bg-black"
style={{
width: 'min(100%, calc(100vh * 4 / 3))',
height: 'min(100%, calc(100vw * 3 / 4))',
maxWidth: '100%',
maxHeight: '100%',
aspectRatio: '4 / 3',
}}
>
<div className="flex h-full w-full items-center justify-center overflow-hidden">{children}</div>
</div>
</div>
);
}