import { TextField } from '@dvn/core/doldurma/src/fields/text';
export function findFieldNestedField(fields, fieldId) {
  if (fieldId.includes('.')) {
    const nestedFieldId = fieldId.split('.')[0];
    return fields.find(field => field.id === nestedFieldId);
  }
  return undefined;
}
export function findField(fields, fieldId) {
  if (fieldId === 'fullName') {
    return new TextField('fullName', '');
  }
  return fields.find(field => field.id === fieldId) || findFieldNestedField(fields, fieldId);
}
