import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; import type { IServiceProject } from '@openpanel/db'; import { PlusIcon, XIcon } from 'lucide-react'; import type { Control, FieldArrayWithId, UseFieldArrayAppend, UseFieldArrayRemove, UseFormRegister, UseFormSetValue, UseFormWatch, } from 'react-hook-form'; interface ProjectMapperProps { fields: FieldArrayWithId[]; append: UseFieldArrayAppend; remove: UseFieldArrayRemove; projects: IServiceProject[]; register: UseFormRegister; watch: UseFormWatch; setValue: UseFormSetValue; } export function ProjectMapper({ fields, append, remove, projects, register, watch, setValue, }: ProjectMapperProps) { return (
{fields.length === 0 && (

Map source project IDs to your OpenPanel projects. If you skip mapping all data will be imported to your current project.

)} {fields.length > 0 && (
{fields.map((field, index) => (
))}
)}
); }