/**
 * Form state shared by the server actions and the client forms.
 *
 * It lives outside `app/actions.ts` because a `"use server"` module may only
 * export async functions.
 */

export type FormState = {
  status: "idle" | "success" | "error";
  /** Field-level messages, keyed by field name. */
  errors?: Record<string, string>;
  /** A single message for the error summary. */
  message?: string;
};

export const initialFormState: FormState = { status: "idle" };
