import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{Schema}from"../Schema";import{FieldDetails}from"./FieldDetails";import{generateDeepLink}from"../common/LinkToField";function PropertyDetailsComponent({field:e,skipWriteOnly:i,skipReadOnly:r,level:s=1,showTitle:t,renderDiscriminatorSwitch:a,isFirst:o,fieldParentsName:n,disableDeepLinks:d,oneOfLevel:p}){const l=d?void 0:generateDeepLink(e),m=!e.schema.isPrimitive&&!e.schema.isCircular;return _jsxs(Wrapper,{isFist:o,expanded:m,className:"property",children:[_jsx(FieldDetails,{field:e,renderDiscriminatorSwitch:a,deepLink:l,fieldParentsName:n}),m&&_jsx(Schema,{schema:e.schema,skipReadOnly:r,skipWriteOnly:i,showTitle:t,expandable:!0,level:s+1,fieldParentsName:[...n||[],e.name],deepLink:l,required:e.required,disableDeepLinks:d,oneOfLevel:p})]})}export const PropertyDetails=memo(PropertyDetailsComponent);const Wrapper=styled.div`
  padding: ${({isFist:e})=>`var(--schema-${e?"fist-":""}property-details-spacing)`} 0
    ${({expanded:e})=>e?0:"var(--schema-property-details-spacing)"};
  ${({expanded:e})=>!e&&"border-bottom: 1px solid var(--border-color-primary)"};

  // This styles needs to override the dividers when array closing label is present
  &:has(+ span.array-closing-label) {
    border-bottom: none;
    padding-bottom: calc(var(--schema-property-details-spacing) / 2);

    .view-nested-wrapper {
      border-bottom: none;
      padding-bottom: 0;
    }
  }
`;
//# sourceMappingURL=PropertyDetails.js.map