forms.tsx 716 B

12345678910111213141516171819202122232425262728293031323334
  1. 'use client'
  2. import React from 'react'
  3. import { useSearchParams } from 'next/navigation'
  4. import NormalForm from './normalForm'
  5. import OneMoreStep from './oneMoreStep'
  6. import cn from '@/utils/classnames'
  7. const Forms = () => {
  8. const searchParams = useSearchParams()
  9. const step = searchParams.get('step')
  10. const getForm = () => {
  11. switch (step) {
  12. case 'next':
  13. return <OneMoreStep />
  14. default:
  15. return <NormalForm />
  16. }
  17. }
  18. return <div className={
  19. cn(
  20. 'flex flex-col items-center w-full grow justify-center',
  21. 'px-6',
  22. 'md:px-[108px]',
  23. )
  24. }>
  25. <div className='flex flex-col md:w-[400px]'>
  26. {getForm()}
  27. </div>
  28. </div>
  29. }
  30. export default Forms