import { Scroller } from '../atoms/scroller.js'
import h from '../shared/h.js'

const VARIANTS = {
  xl: [1.25, 1.25, 1.25]
}

export function Slider ({ _model, _variant, children, ...props }) {
  const autoplay = props.autoplay ?? _model?.autoplay ?? false
  const infinite = props.infinite ?? _model?.infinite ?? false
  const interval = props.interval ?? _model?.interval ?? 3500
  const hideControls = props.hideControls ?? _model?.hideControls ?? false

  return h('div', {
    ...props,
    className: 'w-full',
    children: h(Scroller, {
      _count: VARIANTS[_variant],
      _autoplay: autoplay,
      _infinite: infinite,
      _interval: interval,
      _hideControls: hideControls,
      children
    })
  })
}
