import{jsx as _jsx}from"react/jsx-runtime";import{memo}from"react";import{useLocation}from"react-router-dom";import{useAtomValue}from"jotai/index";import{pathIncludesLink}from"../../utils";import{operationStore}from"../../jotai/operation";import{extractTypeFromDeepLink}from"./helpers";import{ViewNested}from"../ViewNested";import{useTranslate}from"../../hooks";function SubSchemaComponent({expandByDefault:e,deepLink:o,level:r,expandable:t=!1,isNestedArray:a=!1,isArray:i="",propertyLength:n="",children:p,operationPointer:m}){var s;const l=useTranslate(),d=useLocation(),u=pathIncludesLink(d,o),c=extractTypeFromDeepLink(o),x=useAtomValue(operationStore(m||"")),f=`${l("openapi.actions.show","Show")} ${1===Number(n)?"":n} ${i&&"array "}${1!==n?"properties":"property"}`;return _jsx(ViewNested,{expandByDefault:e||u,level:r,isNestedArray:a,expandable:t,expandText:f,children:p,expandedAll:null===(s=x[c])||void 0===s?void 0:s.expandedAll})}export const SubSchema=memo(SubSchemaComponent);
//# sourceMappingURL=SubSchema.js.map