import h from '../shared/h.js'
import { ABTest } from './container/ab-test.js'
import { Default } from './container/default.js'
import { FilteredSection, SearchableSection } from './container/filtered-section.js'
import { Footer } from './container/footer.js'
import { Header } from './container/header.js'
import { List } from './container/list.js'
import { Main } from './container/main.js'
import { Raw } from './container/raw.js'
import { Section } from './container/section.js'

export function Container ({ _variant, _wrap, ...props }) {
  const variants = {
    // Framework
    header: Header,
    footer: Footer,
    main: Main,
    section: Section,
    filtered: FilteredSection,
    searchable: SearchableSection,

    // Content
    raw: Raw,
    list: List,
    abtest: ABTest
  }

  return h(variants[_variant] || Default, { ...props, _wrap })
}
