import { FormStore } from 'features/FormStore'

import { useUserInfo } from './hooks'
import { PersonalInfoForm } from '../PersonalInfoForm'

export const PagePersonalInfo = () => {
  const {
    loader,
    onSubmit,
    userInfo,
  } = useUserInfo()
  if (!userInfo) return null
  return (
    <FormStore initialState={userInfo}>
      <PersonalInfoForm onSubmit={onSubmit} loader={loader} />
    </FormStore>
  )
}
