'use client';
import React from 'react';
import RenderFields from '../../forms/RenderFields/index.js';
import { Gutter } from '../Gutter/index.js';
const baseClass = 'document-fields';
export const DocumentFields = (props)=>{
    const { AfterFields, BeforeFields, description, fieldMap, forceSidebarWrap } = props;
    const mainFields = fieldMap.filter(({ isSidebar })=>!isSidebar);
    const sidebarFields = fieldMap.filter(({ isSidebar })=>isSidebar);
    const hasSidebarFields = sidebarFields && sidebarFields.length > 0;
    return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("div", {
        className: [
            baseClass,
            hasSidebarFields ? `${baseClass}--has-sidebar` : `${baseClass}--no-sidebar`,
            forceSidebarWrap && `${baseClass}--force-sidebar-wrap`
        ].filter(Boolean).join(' ')
    }, /*#__PURE__*/ React.createElement("div", {
        className: `${baseClass}__main`
    }, /*#__PURE__*/ React.createElement(Gutter, {
        className: `${baseClass}__edit`
    }, /*#__PURE__*/ React.createElement("header", {
        className: `${baseClass}__header`
    }, description && /*#__PURE__*/ React.createElement("div", {
        className: `${baseClass}__sub-header`
    })), BeforeFields, /*#__PURE__*/ React.createElement(RenderFields, {
        className: `${baseClass}__fields`,
        fieldMap: mainFields
    }), AfterFields)), hasSidebarFields && /*#__PURE__*/ React.createElement("div", {
        className: `${baseClass}__sidebar-wrap`
    }, /*#__PURE__*/ React.createElement("div", {
        className: `${baseClass}__sidebar`
    }, /*#__PURE__*/ React.createElement("div", {
        className: `${baseClass}__sidebar-fields`
    }, /*#__PURE__*/ React.createElement(RenderFields, {
        fieldMap: sidebarFields
    }))))));
};

//# sourceMappingURL=index.js.map