export type FieldDefinition = {
  name: string;
  label: string;
  component: string;
  rules: string[];
  default: unknown;
  hint: string | null;
  readonly: boolean;
  options: Record<string, string> | null;
  multiple: boolean;
  viewPermission: string | null;
  updatePermission: string | null;
  translatable: boolean;
  generateFrom: string | null;
  quickCreate: { resource: string; labelKey: string } | null;
  relatedResource: string | null;
  relatedLabelKey: string | null;
  fields?: FieldDefinition[] | null;
  maxRows?: number | null;
  minRows?: number | null;
  // NestedResourceEditor fields
  schema?: FieldDefinition[] | null;
  isSortable?: boolean;
  isNestable?: boolean;
  parentField?: string;
  virtual?: boolean;
  // Conditional visibility — show only when another field has a specific value
  visibleWhen?: { field: string; value: unknown } | null;
  // NestedResourceEditor label meta (translated server-side)
  addItemLabel?: string;
  noItemsLabel?: string;
  editItemLabel?: string;
  linkTypeUrlLabel?: string;
  linkTypeResourceLabel?: string;
  selectTypeLabel?: string;
  selectRecordLabel?: string;
  publicResourcesUrl?: string;
  topLevelLabel?: string;
  subItemOfLabel?: string;
};
