'use client';
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import React from 'react';
import { useAuth } from '../../../providers/Auth/index.js';
import { EditDepthProvider } from '../../../providers/EditDepth/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import { Drawer, DrawerToggler } from '../../Drawer/index.js';
import { useFormsManager } from '../FormsManager/index.js';
import { EditManyBulkUploadsDrawerContent } from './DrawerContent.js';
import './index.scss';
export const baseClass = 'edit-many-bulk-uploads';
export const EditManyBulkUploads = (props)=>{
    const { collection: { slug } = {}, collection } = props;
    const { permissions } = useAuth();
    const { t } = useTranslation();
    const { forms } = useFormsManager();
    // Access forms managed in bulk uploads
    const collectionPermissions = permissions?.collections?.[slug];
    const hasUpdatePermission = collectionPermissions?.update;
    const drawerSlug = `edit-${slug}-bulk-uploads`;
    if (!hasUpdatePermission) {
        return null;
    }
    return /*#__PURE__*/ _jsxDEV("div", {
        className: baseClass,
        children: [
            /*#__PURE__*/ _jsxDEV(DrawerToggler, {
                "aria-label": t('general:editAll'),
                className: `${baseClass}__toggle`,
                slug: drawerSlug,
                children: t('general:editAll')
            }, void 0, false, {
                fileName: "src/elements/BulkUpload/EditMany/index.tsx",
                lineNumber: 40,
                columnNumber: 7
            }, this),
            /*#__PURE__*/ _jsxDEV(EditDepthProvider, {
                children: /*#__PURE__*/ _jsxDEV(Drawer, {
                    Header: null,
                    slug: drawerSlug,
                    children: /*#__PURE__*/ _jsxDEV(EditManyBulkUploadsDrawerContent, {
                        collection: collection,
                        drawerSlug: drawerSlug,
                        forms: forms
                    }, void 0, false, {
                        fileName: "src/elements/BulkUpload/EditMany/index.tsx",
                        lineNumber: 49,
                        columnNumber: 11
                    }, this)
                }, void 0, false, {
                    fileName: "src/elements/BulkUpload/EditMany/index.tsx",
                    lineNumber: 48,
                    columnNumber: 9
                }, this)
            }, void 0, false, {
                fileName: "src/elements/BulkUpload/EditMany/index.tsx",
                lineNumber: 47,
                columnNumber: 7
            }, this)
        ]
    }, void 0, true, {
        fileName: "src/elements/BulkUpload/EditMany/index.tsx",
        lineNumber: 39,
        columnNumber: 5
    }, this);
};

//# sourceMappingURL=index.js.map