export interface FormWithErrors {
    errors: Record<string, string | undefined>;
}

export function formErrors(
    form: FormWithErrors,
    key: string,
): string[] {
    const error = form.errors[key];

    return error ? [error] : [];
}
