import React from "react";
import { Composition } from "remotion";
import { MumumShort } from "./MumumShort";
import { defaultProps } from "./data/mumum";

export const RemotionRoot: React.FC = () => {
  return (
    <Composition
      id="MumumShort"
      component={MumumShort}
      defaultProps={defaultProps}
      durationInFrames={defaultProps.durationInFrames}
      fps={defaultProps.fps}
      width={defaultProps.width}
      height={defaultProps.height}
      // props(영상 크기·길이)로 메타데이터 동적 설정 → 한 컴포지션이 모든 job 처리
      calculateMetadata={({ props }) => ({
        durationInFrames: props.durationInFrames,
        fps: props.fps,
        width: props.width,
        height: props.height,
      })}
    />
  );
};
