import { useState, useCallback } from "react";
/**
 * Hook for managing sidebar editor state.
 * Provides state and handlers for opening/closing the sidebar editor.
 *
 * @template T - The type of item being edited (must have an id property)
 */
export function useSidebarEditor() {
    const [selectedItem, setSelectedItem] = useState(null);
    const openEditor = useCallback((item) => {
        setSelectedItem(item);
    }, []);
    const closeEditor = useCallback(() => {
        setSelectedItem(null);
    }, []);
    return {
        selectedItem,
        openEditor,
        closeEditor,
        isOpen: selectedItem !== null,
    };
}
export default useSidebarEditor;
//# sourceMappingURL=useSidebarEditor.js.map