import{jsx as s}from"react/jsx-runtime";import{createElement as c}from"react";import{useRouter as f}from"../hooks/index.js";import{getDisplayName as R}from"./utils.js";import{IS_BROWSER as h}from"../utils/dom.js";function P(r){const e=({disableRouter:i=!1,...t})=>{const o=t.basePath??"/",m=t.router??"history",{Router:u,routerProps:a}=f(m,o);return h&&!i?c(u,{...a,key:o},s(r,{...t})):s(r,{...t})};return e.displayName=`WithRouter(${R(r)})`,e}export{P as withRouter};
