import {
  UserDetailPage
} from "./chunk-XIHVSZ6I.js";
import "./chunk-V5J73NPW.js";
import "./chunk-XIZLPYEE.js";
import "./chunk-INNFZYX2.js";
import "./chunk-BDGZ4EQO.js";
import "./chunk-LAVHRER2.js";
import "./chunk-Y7QKP6QU.js";
import {
  useUser
} from "./chunk-XKVXLDSJ.js";
import {
  productsQueryKeys
} from "./chunk-BA2HXHTW.js";
import {
  queryClient
} from "./chunk-RHKRREUU.js";
import "./chunk-ZA2KFUFR.js";
import {
  sdk
} from "./chunk-RIN4CBRB.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
};
