import { useEffect } from 'react';
export var useAutoFocus = function (inputRef, isEditing) {
    useEffect(function () {
        var _a, _b, _c, _d;
        if (isEditing) {
            var position = (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.length;
            (_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.focus();
            (_d = inputRef.current) === null || _d === void 0 ? void 0 : _d.setSelectionRange(position, position);
        }
    }, [inputRef, isEditing]);
};
