use swr loading state

This commit is contained in:
Josh Hawkins 2024-12-03 08:58:01 -06:00
parent a4d91a1e71
commit e66cfbce99

View File

@ -687,7 +687,7 @@ function Timeline({
// motion data // motion data
const { data: motionData } = useSWR<MotionData[]>([ const { data: motionData, isLoading } = useSWR<MotionData[]>([
"review/activity/motion", "review/activity/motion",
{ {
before: timeRange.before, before: timeRange.before,
@ -725,7 +725,7 @@ function Timeline({
<div className="pointer-events-none absolute inset-x-0 top-0 z-20 h-[30px] w-full bg-gradient-to-b from-secondary to-transparent"></div> <div className="pointer-events-none absolute inset-x-0 top-0 z-20 h-[30px] w-full bg-gradient-to-b from-secondary to-transparent"></div>
<div className="pointer-events-none absolute inset-x-0 bottom-0 z-20 h-[30px] w-full bg-gradient-to-t from-secondary to-transparent"></div> <div className="pointer-events-none absolute inset-x-0 bottom-0 z-20 h-[30px] w-full bg-gradient-to-t from-secondary to-transparent"></div>
{timelineType == "timeline" ? ( {timelineType == "timeline" ? (
motionData ? ( !isLoading ? (
<MotionReviewTimeline <MotionReviewTimeline
segmentDuration={zoomSettings.segmentDuration} segmentDuration={zoomSettings.segmentDuration}
timestampSpread={zoomSettings.timestampSpread} timestampSpread={zoomSettings.timestampSpread}