A generic, reusable React component for managing ordered lists of structured objects, supporting inline editing, item removal, multi-line paste, and optional deferred saves. ## Key Components ### `ArrayEntryManagerProps` | Prop | Type | Description | |---|---|---| | `title` | `ReactNode` | Section header; supports strings or badge elements | | `items` | `T[]` | Array of items to manage | | `onChange` | `(items: T[]) => void` | Called when items change (immediately or on save) | | `fieldKey` | `keyof T` | Object key to bind each input to | | `placeholder` | `string` | Input placeholder text | | `emptyMessage` | `string` | Text shown when the list is empty | | `addButtonText` | `string` | Label for the add button | | `requireSave` | `boolean` | Enables draft mode — defers `onChange` until Save is clicked | | `onDirtyChange` | `(isDirty: boolean) => void` | Notifies parent of unsaved changes | | `renderLabel` | `(item: T, index: number) => ReactNode` | Custom per-entry label or badge renderer | | `isSaving` | `boolean` | Shows spinner on the Save button during async operations | ### `ArrayEntryManager` (Component) - **Draft mode** (`requireSave=true`): maintains local `draftItems` state and syncs to parent only on explicit save, preventing mid-edit prop conflicts. - **Multi-line paste**: splits clipboard text on newlines and inserts each line as a separate entry starting at the pasted position. - **Add at top**: new entries are prepended for faster access. ## Usage Example ```typescript import { ArrayEntryManager } from './array-entry-manager'; interface ReleaseUrl { github_release_url: string; } title="GitHub Release URLs" items={releaseUrls} onChange={setReleaseUrls} fieldKey="github_release_url" placeholder="https://github.com/org/repo/releases/tag/v1.0.0" emptyMessage="No release URLs added yet." addButtonText="Add URL" requireSave saveButtonText="Save URLs" isSaving={isSaving} onDirtyChange={(dirty) => setHasUnsavedChanges(dirty)} /> ``` **Source:** [`array-entry-manager.tsx`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/array-entry-manager.tsx)