import { Controller } from "react-hook-form" import { Option } from "../../../../types/shared" import { countries } from "../../../../utils/countries" import FormValidator from "../../../../utils/form-validator" import { NestedForm } from "../../../../utils/nested-form" import InputField from "../../../molecules/input" import { NextSelect } from "../../../molecules/select/next-select" export type CustomsFormType = { mid_code: string | null hs_code: string | null origin_country: Option | null } type CustomsFormProps = { form: NestedForm } /** * Re-usable nested form used to submit customs information for products and their variants. * @example * */ const CustomsForm = ({ form }: CustomsFormProps) => { const { register, path, control, formState: { errors }, } = form const countryOptions = countries.map((c) => ({ label: c.name, value: c.alpha2, })) return (
{ return ( ) }} />
) } export default CustomsForm