fix: handle file upload status correctly, add serverless machine type

This commit is contained in:
BennyKok
2023-12-24 18:53:32 +08:00
parent dc5ae7a7b1
commit 850d8473ad
18 changed files with 1716 additions and 207 deletions
@@ -1,28 +1,28 @@
import * as z from "zod";
import { useForm } from "react-hook-form";
import { FieldConfig, FieldConfigItem } from "../types";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "../../accordion";
import { FormField } from "../../form";
import { DEFAULT_ZOD_HANDLERS, INPUT_COMPONENTS } from "../config";
import type { FieldConfig, FieldConfigItem } from "../types";
import {
beautifyObjectName,
getBaseSchema,
getBaseType,
zodToHtmlInputProps,
} from "../utils";
import { FormField } from "../../form";
import { DEFAULT_ZOD_HANDLERS, INPUT_COMPONENTS } from "../config";
import AutoFormArray from "./array";
import type { useForm } from "react-hook-form";
import type * as z from "zod";
function DefaultParent({ children }: { children: React.ReactNode }) {
return <>{children}</>;
}
export default function AutoFormObject<
SchemaType extends z.ZodObject<any, any>,
SchemaType extends z.ZodObject<any, any>
>({
schema,
form,
+9 -13
View File
@@ -1,20 +1,16 @@
"use client";
import React from "react";
import { z } from "zod";
import { Form } from "../form";
import { DefaultValues, useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { Button } from "../button";
import { Form } from "../form";
import type { FieldConfig } from "./types";
import type { ZodObjectOrWrapped } from "./utils";
import { getDefaultValues, getObjectFormSchema } from "./utils";
import AutoFormObject from "@/components/ui/auto-form/fields/object";
import { cn } from "@/lib/utils";
import { FieldConfig } from "./types";
import {
ZodObjectOrWrapped,
getDefaultValues,
getObjectFormSchema,
} from "./utils";
import AutoFormObject from "./fields/object";
import { zodResolver } from "@hookform/resolvers/zod";
import type { DefaultValues } from "react-hook-form";
import { useForm } from "react-hook-form";
import type { z } from "zod";
export function AutoFormSubmit({ children }: { children?: React.ReactNode }) {
return <Button type="submit">{children ?? "Submit"}</Button>;