import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import styled from"styled-components";import{useAtomValue}from"jotai";import{Schema}from"../Schema";import{FieldDetails}from"./FieldDetails";import{generateDeepLink}from"../common/LinkToField";import{activeMimeNameAtom}from"../../jotai/app";function PropertyDetailsComponent({field:e,skipWriteOnly:i,skipReadOnly:r,level:s=1,showTitle:t,renderDiscriminatorSwitch:a,isFirst:o,fieldParentsName:n,disableDeepLinks:m,oneOfLevel:p,slug:l}){const d=useAtomValue(activeMimeNameAtom),c=m?void 0:generateDeepLink(e,d),h=l&&c?`${l}&${c.replace("#","")}`:c,y=!e.schema.isPrimitive&&!e.schema.isCircular;return _jsxs(Wrapper,{isFist:o,expanded:y,className:"property",children:[_jsx(FieldDetails,{field:e,renderDiscriminatorSwitch:a,deepLink:h,fieldParentsName:n}),y&&_jsx(Schema,{schema:e.schema,skipReadOnly:r,skipWriteOnly:i,showTitle:t,expandable:!0,level:s+1,fieldParentsName:[...n||[],e.name],deepLink:h,required:e.required,disableDeepLinks:m,oneOfLevel:p,slug:l})]})}export const PropertyDetails=memo(PropertyDetailsComponent);const Wrapper=styled.div`
  width: 100%;
  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