import { FormItem } from "../components/BasicForm";

function createDetailData(formItems: FormItem[], data: Record<string, string>) {
  const detail: Record<string, any> = {};

  for (let i = 0; i < formItems.length; i++) {
    const { field } = formItems[i];
    detail[field] = data[field];
  }
  return detail;
}

export default createDetailData;
