Skip to content

Commit

Permalink
Merge pull request #53 from cipriancaba/main
Browse files Browse the repository at this point in the history
  • Loading branch information
vantezzen authored Dec 1, 2023
2 parents 60e8c89 + d3d0734 commit cff9558
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/ui/auto-form/fields/array.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@ import AutoFormObject from "./object";
import { Button } from "../../button";
import { Plus, Trash } from "lucide-react";
import { Separator } from "../../separator";
import { FieldConfig } from '../types';

Check failure on line 13 in src/components/ui/auto-form/fields/array.tsx

View workflow job for this annotation

GitHub Actions / deploy

'FieldConfig' is declared but its value is never read.

export default function AutoFormArray({
name,
item,
form,
path = [],
fieldConfig,
}: {
name: string;
item: z.ZodArray<any>;
form: ReturnType<typeof useForm>;
path?: string[];
fieldConfig?: any
}) {
const { fields, append, remove } = useFieldArray({
control: form.control,
Expand All @@ -39,6 +42,7 @@ export default function AutoFormArray({
<AutoFormObject
schema={item._def.type as z.ZodObject<any, any>}
form={form}
fieldConfig={fieldConfig}
path={[...path, index.toString()]}
/>
<Button
Expand Down
1 change: 1 addition & 0 deletions src/components/ui/auto-form/fields/object.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default function AutoFormObject<
name={name}
item={item as unknown as z.ZodArray<any>}
form={form}
fieldConfig={fieldConfig?.[name] ?? {}}
path={[...path, name]}
/>
);
Expand Down

0 comments on commit cff9558

Please sign in to comment.