separate layout from aspect classes

This commit is contained in:
Josh Hawkins 2024-04-01 08:20:22 -05:00
parent 9fbb516c27
commit 3098762254

View File

@ -816,20 +816,23 @@ function MotionReview({
>
{reviewCameras.map((camera) => {
let grow;
let spans;
const aspectRatio = camera.detect.width / camera.detect.height;
if (aspectRatio > 2) {
grow = "sm:col-span-2 aspect-wide";
grow = "aspect-wide";
spans = "sm:col-span-2";
} else if (aspectRatio < 1) {
grow = "md:row-span-2 md:h-full aspect-tall";
grow = "md:h-full aspect-tall";
spans = "md:row-span-2";
} else {
grow = "aspect-video";
}
const detectionType = getDetectionType(camera.name);
return (
<div className={`relative ${grow}`}>
<div className={`relative ${spans}`}>
<PreviewPlayer
key={camera.name}
className={`rounded-2xl ${grow}`}
className={`rounded-2xl ${spans} ${grow}`}
camera={camera.name}
timeRange={currentTimeRange}
startTime={previewStart}