import React from 'react'; import InlineRenameInput from './InlineRenameInput'; interface EditableEntryTitleProps { isEditing: boolean; draftValue: string; onChange: (value: string) => void; onSubmit: () => void; onCancel: (event?: React.SyntheticEvent) => void; isSaving: boolean; canSubmit: boolean; inputRef: (ref: HTMLInputElement | null) => void; allowInlineEdit: boolean | undefined; onBeginEditing: (event: React.SyntheticEvent) => void; children: React.ReactNode; className?: string; } const EditableEntryTitle: React.FC = ({ isEditing, draftValue, onChange, onSubmit, onCancel, isSaving, canSubmit, inputRef, allowInlineEdit, onBeginEditing, children, className, }) => { if (isEditing) { return (
); } return ( { if (!allowInlineEdit) return; if (event.key === 'Enter') { onBeginEditing(event); } }} > {children} ); }; export default EditableEntryTitle;