import{useEffect as s,useState as c}from"react";import{getPathPrefix as d}from"@redocly/theme/core/utils";import{getScorecardSlug as f}from"../shared-utils";function S(e){const[t,o]=c(),[n,r]=c(!0);return s(()=>{r(!0),i(e).then(a=>{o(a),r(!1)})},[e]),{scorecard:t,isLoading:n}}function i(e){return fetch(`${d()}/_scorecard/${f(e)}`).then(t=>t.json()).catch(()=>{})}export{i as fetchDetailedScorecard,S as useDetailedScorecard};
