'use client'

import { IntakeConfig } from '@/components/admin/rounds/config/intake-config'
import { FilteringConfig } from '@/components/admin/rounds/config/filtering-config'
import { EvaluationConfig } from '@/components/admin/rounds/config/evaluation-config'
import { SubmissionConfig } from '@/components/admin/rounds/config/submission-config'
import { MentoringConfig } from '@/components/admin/rounds/config/mentoring-config'
import { LiveFinalConfig } from '@/components/admin/rounds/config/live-final-config'
import { DeliberationConfig } from '@/components/admin/rounds/config/deliberation-config'

type RoundConfigFormProps = {
  roundType: string
  config: Record<string, unknown>
  onChange: (config: Record<string, unknown>) => void
  juryGroups?: Array<{ id: string; name: string }>
}

export function RoundConfigForm({ roundType, config, onChange, juryGroups }: RoundConfigFormProps) {
  switch (roundType) {
    case 'INTAKE':
      return <IntakeConfig config={config} onChange={onChange} />
    case 'FILTERING':
      return <FilteringConfig config={config} onChange={onChange} />
    case 'EVALUATION':
      return <EvaluationConfig config={config} onChange={onChange} />
    case 'SUBMISSION':
      return <SubmissionConfig config={config} onChange={onChange} />
    case 'MENTORING':
      return <MentoringConfig config={config} onChange={onChange} />
    case 'LIVE_FINAL':
      return <LiveFinalConfig config={config} onChange={onChange} />
    case 'DELIBERATION':
      return <DeliberationConfig config={config} onChange={onChange} juryGroups={juryGroups} />
    default:
      return (
        <div className="rounded-lg border border-dashed p-6 text-center text-sm text-muted-foreground">
          Unknown round type: {roundType}
        </div>
      )
  }
}
