import React, { useState } from 'react' import { type AnimatedSceneProps } from '~components/Illustration/Scene/Scene' import { Base } from '~components/Illustration/subcomponents/Base/Base' import { VideoPlayer } from '~components/Illustration/subcomponents/VideoPlayer' /** * This component is a snowflake. It plays two assets one after the other: * - An "initial" animation that is only ever played once, never looping * - An "ambient" animation that can be looped, depending on the props passed into it */ export const BrandMomentCaptureIntro = ({ isAnimated, alt, enableAspectRatio, ...otherProps }: AnimatedSceneProps): JSX.Element => { const [firstAnimationComplete, setFirstAnimationComplete] = useState(false) const aspectRatio = enableAspectRatio ? 'landscape' : undefined if (!isAnimated) { return ( ) } if (firstAnimationComplete) { return ( ) } return ( setFirstAnimationComplete(true)} loop={false} /> ) } BrandMomentCaptureIntro.displayName = 'BrandMomentCaptureIntro'