import {
  UserDetailPage
} from "./chunk-Y6NK6GBB.js";
import "./chunk-E74OUNA3.js";
import "./chunk-H6MYB7GB.js";
import "./chunk-INNFZYX2.js";
import "./chunk-BDGZ4EQO.js";
import "./chunk-LAVHRER2.js";
import "./chunk-Y7QKP6QU.js";
import {
  useUser
} from "./chunk-GKGLVDDV.js";
import {
  productsQueryKeys
} from "./chunk-5CK6XEFV.js";
import {
  queryClient
} from "./chunk-RHKRREUU.js";
import "./chunk-ZA2KFUFR.js";
import {
  sdk
} from "./chunk-ZBWL72TB.js";
import "./chunk-NBMM2TZK.js";

// src/pages/users/user-detail/breadcrumb.tsx
import { jsx } from "react/jsx-runtime";
var UserDetailBreadcrumb = (props) => {
  const { id } = props.params || {};
  const { user } = useUser(id, void 0, {
    initialData: props.data,
    enabled: Boolean(id)
  });
  if (!user) {
    return null;
  }
  const name = [user.first_name, user.last_name].filter(Boolean).join(" ");
  const display = name || user.email;
  return /* @__PURE__ */ jsx("span", { children: display });
};

// src/pages/users/user-detail/loader.ts
var userDetailQuery = (id) => ({
  queryKey: productsQueryKeys.detail(id),
  queryFn: async () => sdk.admin.users.$id.query({ $id: id })
});
var userLoader = async ({ params }) => {
  const id = params.id;
  const query = userDetailQuery(id);
  return queryClient.ensureQueryData(query);
};
export {
  UserDetailBreadcrumb as Breadcrumb,
  UserDetailPage as Component,
  userLoader as loader
};
