import React from "react"; import { FeatureCollection } from "geojson"; import dynamic from "next/dynamic"; import { Controller, FieldPath, FieldValues } from "react-hook-form"; import { Prettify } from "@/types"; import LoadingMap from "../LoadingMap"; import { Field, GenericFieldProps } from "./Field"; import type { ZoneEditorProps } from "./ZoneEditor"; const ZoneEditor = dynamic(() => import("./ZoneEditor"), { ssr: false, loading: LoadingMap, }); type ZoneEditorFieldProps< TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath = FieldPath, > = Prettify< GenericFieldProps & Omit >; export const ZoneEditorField = < TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath = FieldPath, >( props: ZoneEditorFieldProps, ) => { const { name, control, label, className, labelClassName } = props; return (
( onChange(geoJson)} /> )} />
); };