import { PropsWithChildren } from 'react'

export const noop = () => {}

export function wrapProps(props: PropsWithChildren<CustomPropsType>) {
  let {
    adpId,
    autoplay,
    loop = true,
    muted = false,
    showMusk,
    zIndex = 1,
    openEmbeddedMiniProgram = noop,
    onPlay = noop,
    onPause = noop,
    onEnded = noop,
    onTimeUpdate = noop,
    onStop = noop,
    onError = noop,
    onLoad = noop,
    onView = noop,
    onClick = noop,
    onClose = noop
  } = props

  if (typeof zIndex !== 'number')
    zIndex = 1

  return {
    adpId,
    autoplay,
    loop,
    muted,
    showMusk,
    zIndex,
    openEmbeddedMiniProgram,
    onPlay,
    onPause,
    onEnded,
    onTimeUpdate,
    onStop,
    onError,
    onLoad,
    onView,
    onClick,
    onClose
  }
}