import type { FormikHelpers } from 'formik';
import { Form, Formik } from 'formik';
import { useEffect, useState } from 'react';
import tw from 'twin.macro';
import { array, number, object, string } from 'yup';
import createAllocation from '@/api/admin/nodes/allocations/createAllocation';
import getAllocations from '@/api/admin/nodes/getAllocations';
import getAllocations2 from '@/api/admin/nodes/allocations/getAllocations';
import Button from '@/components/elements/Button';
import Field from '@/components/elements/Field';
import type { Option } from '@/components/elements/SelectField';
import SelectField from '@/components/elements/SelectField';
interface Values {
ips: string[];
ports: number[];
alias: string;
}
const distinct = (value: any, index: any, self: any) => {
return self.indexOf(value) === index;
};
function CreateAllocationForm({ nodeId }: { nodeId: number }) {
const [ips, setIPs] = useState