import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime";
import { useRouteCache } from '../../../../providers/RouteCache/index.js';
import { useTranslation } from '../../../../providers/Translation/index.js';
import { useDocumentDrawer } from '../../../DocumentDrawer/index.js';
import { ListSelectionButton } from '../../../ListSelection/index.js';
export const EditFolderAction = ({ id, folderCollectionSlug })=>{
    const { clearRouteCache } = useRouteCache();
    const { t } = useTranslation();
    const [FolderDocumentDrawer, , { closeDrawer, openDrawer }] = useDocumentDrawer({
        id,
        collectionSlug: folderCollectionSlug
    });
    if (!id) {
        return null;
    }
    return /*#__PURE__*/ _jsxDEV(_Fragment, {
        children: [
            /*#__PURE__*/ _jsxDEV(ListSelectionButton, {
                onClick: openDrawer,
                type: "button",
                children: t('general:edit')
            }, void 0, false, {
                fileName: "src/elements/FolderView/Drawers/EditFolderAction/index.tsx",
                lineNumber: 24,
                columnNumber: 7
            }, this),
            /*#__PURE__*/ _jsxDEV(FolderDocumentDrawer, {
                onSave: ()=>{
                    closeDrawer();
                    clearRouteCache();
                }
            }, void 0, false, {
                fileName: "src/elements/FolderView/Drawers/EditFolderAction/index.tsx",
                lineNumber: 28,
                columnNumber: 7
            }, this)
        ]
    }, void 0, true);
};

//# sourceMappingURL=index.js.map