import type { EditProfileSchema } from "@/components/MyProfile/Profile/Edit/Form/schema"
import type { Control } from "react-hook-form"
import type { User } from "@/types/user"

export type EditFormProps = {
  user: User
}

export type EditFormContentProps = {
  control: Control<EditProfileSchema>
}

type E = {
  message: string
  path: string
}

export const enum Status {
  error = "error",
  success = "success",
}

type ErrorState = {
  errors?: E[]
  message: string
  status: Status.error
}

type SuccessState = {
  message: string
  status: Status.success
}

export type State = ErrorState | SuccessState | null
