import{useLocation as c}from"react-router-dom";import{getPathnameForLocale as u,withoutPathPrefix as s}from"@redocly/theme/core/utils";import{addTrailingSlash as i}from"../../../../shared/utils";import{useL10nConfig as m}from"../useL10nConfig";import{useProducts as l}from"./useProducts";const x=()=>{const t=l(),o=c(),{locales:r,defaultLocale:e,currentLocale:n}=m();return t.find(a=>i(u(s(o.pathname),e,n,r)).startsWith(a.slug))};export{x as useCurrentProduct};
