import type { User } from "@/types/user"

export type EditFormProps = {
  user: User
}

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

type Data = Record<
  string,
  string | undefined | Record<string, string | undefined>
>

type Issue = {
  field: string
  message: string
}

export type State = {
  data: Data
  message: string
} & (
  | {
      issues: never
      status: Status.success
    }
  | {
      issues: Issue[]
      status: Status.error
    }
)
