cleaning
This commit is contained in:
parent
677fc82685
commit
1d99943361
|
|
@ -1,11 +1,9 @@
|
||||||
import { FC, useEffect } from "react";
|
import { FC } from "react";
|
||||||
import { FMLocal, FieldLocal, FieldProp } from "../../typings";
|
import { FMLocal, FieldLocal, FieldProp } from "../../typings";
|
||||||
import { useLocal } from "@/utils/use-local";
|
|
||||||
import get from "lodash.get";
|
|
||||||
import { TypeDropdown } from "./TypeDropdown";
|
|
||||||
import { FieldToggle } from "./TypeToggle";
|
|
||||||
import { FieldButton } from "./TypeButton";
|
import { FieldButton } from "./TypeButton";
|
||||||
|
import { TypeDropdown } from "./TypeDropdown";
|
||||||
import { FieldRadio } from "./TypeRadio";
|
import { FieldRadio } from "./TypeRadio";
|
||||||
|
import { FieldToggle } from "./TypeToggle";
|
||||||
|
|
||||||
export const SingleOption: FC<{
|
export const SingleOption: FC<{
|
||||||
field: FieldLocal;
|
field: FieldLocal;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import { useLocal } from "@/utils/use-local";
|
import { useLocal } from "@/utils/use-local";
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
|
|
||||||
|
|
@ -9,17 +8,6 @@ export const FieldTypeSwitch: FC<{
|
||||||
label?: string;
|
label?: string;
|
||||||
}> = ({ valueName, description, label }) => {
|
}> = ({ valueName, description, label }) => {
|
||||||
const local = useLocal({ checked: false });
|
const local = useLocal({ checked: false });
|
||||||
// const FormSchema = z.object({
|
|
||||||
// valueName: z.boolean().default(false).optional(),
|
|
||||||
// });
|
|
||||||
// const form = useForm<z.infer<typeof FormSchema>>({
|
|
||||||
// resolver: zodResolver(FormSchema),
|
|
||||||
// });
|
|
||||||
|
|
||||||
// function onSubmit(data: z.infer<typeof FormSchema>) {
|
|
||||||
// console.log({ data });
|
|
||||||
// }
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
@ -29,39 +17,5 @@ export const FieldTypeSwitch: FC<{
|
||||||
>
|
>
|
||||||
{JSON.stringify(local.checked)}
|
{JSON.stringify(local.checked)}
|
||||||
</div>
|
</div>
|
||||||
// <Form {...form}>
|
|
||||||
// <form onSubmit={form.handleSubmit(onSubmit)} className="w-full space-y-6">
|
|
||||||
// <div>
|
|
||||||
// <h3 className="mb-4 text-lg font-medium">
|
|
||||||
// {label != undefined ? label : "-"}
|
|
||||||
// </h3>
|
|
||||||
// <div className="space-y-4">
|
|
||||||
// <FormField
|
|
||||||
// control={form.control}
|
|
||||||
// name="first_value"
|
|
||||||
// render={({ field }) => (
|
|
||||||
// <FormItem className="flex items-center space-x-2">
|
|
||||||
// <div>
|
|
||||||
// <FormLabel className="text-base">
|
|
||||||
// {label != undefined ? label : "-"}
|
|
||||||
// </FormLabel>
|
|
||||||
// <FormDescription>
|
|
||||||
// {description != undefined ? description : "-"}
|
|
||||||
// </FormDescription>
|
|
||||||
// </div>
|
|
||||||
// <FormControl>
|
|
||||||
// <Switch
|
|
||||||
// checked={field.value}
|
|
||||||
// onCheckedChange={field.onChange}
|
|
||||||
// />
|
|
||||||
// </FormControl>
|
|
||||||
// </FormItem>
|
|
||||||
// )}
|
|
||||||
// />
|
|
||||||
// </div>
|
|
||||||
// </div>
|
|
||||||
// <Button type="submit">Submit</Button>
|
|
||||||
// </form>
|
|
||||||
// </Form>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue