// Remotion entry: registers a single composition whose duration/size come from the mvideo project passed
// as inputProps. Bundled by render.mjs via @remotion/bundler. (Provisioned on skill install via
// requires-packages: remotion @remotion/bundler @remotion/renderer.)
import React from "react";
import { registerRoot, Composition } from "remotion";
import { Mvideo } from "./Mvideo.jsx";

const Root = () => (
  <Composition
    id="Mvideo"
    component={Mvideo}
    // Placeholders; the real values are derived from inputProps in calculateMetadata.
    durationInFrames={300}
    fps={30}
    width={1080}
    height={1920}
    defaultProps={{ project: { fps: 30, width: 1080, height: 1920, duration: 300, assets: {}, tracks: [] } }}
    calculateMetadata={({ props }) => {
      const p = props.project ?? {};
      return {
        durationInFrames: Math.max(1, p.duration || 1),
        fps: p.fps || 30,
        width: p.width || 1080,
        height: p.height || 1920,
      };
    }}
  />
);

registerRoot(Root);
