import { useId } from 'react';
import { jsx } from 'react/jsx-runtime';

function withId(WrappedComponent) {
  function WithIdComponent(props) {
    const id = useId();
    return /*#__PURE__*/jsx(WrappedComponent, {
      ...props,
      id: props.id || id
    });
  }
  WithIdComponent.displayName = `withId(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;
  return WithIdComponent;
}

export { withId as default };
//# sourceMappingURL=withId.mjs.map
