"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useDownloadInfo=void 0;const react_1=require("react"),useDownloadInfo=({downloadUrls:e,defaultFileName:o})=>(0,react_1.useMemo)((()=>{if(e)return e.map((({title:e,url:l})=>({url:l,title:e||getFileNameFromUrl(l,o||"openapi.yaml"),iconType:getIconTypeFromUrl(l)})))}),[e,o]);function getFileNameFromUrl(e,o){const l=e.split("?")[0].split(/[\\\/]/).pop();return l&&(l.includes("yaml")||l.includes("json"))?l:o}function getIconTypeFromUrl(e,o){const l=o||e.split("?")[0].split(/[\\\/]/).pop();return l?l.includes("yaml")?"yaml":l.includes("json")?"json":"file":"file"}exports.useDownloadInfo=useDownloadInfo;
//# sourceMappingURL=useDownloadInfo.js.map