import React, { useMemo } from 'react'; import { Player } from '@remotion/player'; import { ShortVideo } from '../remotion/compositions/ShortVideo'; /** * Wraps Remotion's Player component for real-time preview in modals. * Accepts the same ShortVideoProps interface as the Remotion composition. * * @param {object} props * @param {string} props.videoUrl - URL to the base clip video * @param {number} props.durationInSeconds - Video duration in seconds * @param {object|null} props.subtitles - SubtitleConfig or null * @param {object|null} props.hook - HookConfig or null * @param {object|null} props.effects - EffectsConfig or null * @param {string} [props.className] - Additional CSS classes */ export default function RemotionPreview({ videoUrl, durationInSeconds = 30, subtitles = null, hook = null, effects = null, className = '', }) { const fps = 30; const durationInFrames = Math.max(1, Math.round(durationInSeconds * fps)); const inputProps = useMemo( () => ({ videoUrl, durationInFrames, fps, width: 1080, height: 1920, subtitles, hook, effects, }), [videoUrl, durationInFrames, subtitles, hook, effects] ); return (