'use strict';
import { jsx } from 'react/jsx-runtime';
import { EditOtherUser } from '../../../fd-app-toolbox/edit-other-user/EditOtherUser.js';
import { getUserDto } from '../../../server/users/user-manager.js';
import { apiNotFoundError } from '../../../../fd-toolbox/server/web/errors.js';
import { responseMessages } from '../../../../fd-toolbox/server/web/response-messages.js';
import '../../../meta/public-api.js';
import { wellKnownMetaProps } from '../../../../fd-toolbox-core/constants/meta-constants.js';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
async function EditUserByIdPage({
  params
}) {
  const resolvedParams = await params;
  const id = resolvedParams[wellKnownMetaProps.id];
  const userData = await getUserDto(id);
  if (!userData) {
    throw apiNotFoundError(responseMessages.notFoundError);
  }
  return /* @__PURE__ */jsx("main", {
    className: "p-4",
    children: /* @__PURE__ */jsx(EditOtherUser, {
      userId: id,
      userData: {
        id: userData.id,
        email: userData.email
      }
    })
  });
}
__name(EditUserByIdPage, "EditUserByIdPage");

export { EditUserByIdPage as default };
