import { defineComponent, mergeProps, unref, withCtx, createTextVNode, toDisplayString, ref, reactive, createVNode, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderAttr } from 'vue/server-renderer'; import { U as UserProfilePic } from './UserProfilePic-KbXFtZ-c.mjs'; import { B as BasicButton } from './BasicButton-BY5Qzukq.mjs'; import { u as useRouter$1, a as useConfigStore, z as useElementSize, aV as baseConfirmWithId, aW as deleteUser } from './server.mjs'; import { ContentLoader } from 'vue-content-loader'; const _sfc_main$1 = /* @__PURE__ */ defineComponent({ __name: "CustomerCard", __ssrInlineRender: true, props: { user: {} }, emits: ["refresh"], setup(__props, { emit: __emit }) { const router = useRouter$1(); const props = __props; const config = useConfigStore(); const emits = __emit; async function handlerConfirmDeleteUser() { await baseConfirmWithId(config.useString("areYouSureToDeleteThisUser"), props.user.id ?? "", deleteUser, () => emits("refresh")); } return (_ctx, _push, _parent, _attrs) => { _push(`
`); _push(ssrRenderComponent(UserProfilePic, { width: "60", src: _ctx.user.avatar, "just-show-profile": "" }, null, _parent)); _push(`
${ssrInterpolate(_ctx.user.name)}
${ssrInterpolate(_ctx.user.infoText)}
`); if (unref(config).isSeller) { _push(`
`); _push(ssrRenderComponent(BasicButton, { class: "!h-7 w-full", onClick: ($event) => unref(router).push({ name: "user-edit-id", params: { id: _ctx.user.id } }) }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(`${ssrInterpolate(unref(config).useString("edit"))}`); } else { return [ createTextVNode(toDisplayString(unref(config).useString("edit")), 1) ]; } }), _: 1 }, _parent)); _push(ssrRenderComponent(BasicButton, { class: "!h-7 w-full border-red text-red mt1", onClick: handlerConfirmDeleteUser }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(`${ssrInterpolate(unref(config).useString("delete"))}`); } else { return [ createTextVNode(toDisplayString(unref(config).useString("delete")), 1) ]; } }), _: 1 }, _parent)); _push(`
`); } else { _push(ssrRenderComponent(BasicButton, { class: "!h-7 w-1/4" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(`${ssrInterpolate(unref(config).useString("details"))}`); } else { return [ createTextVNode(toDisplayString(unref(config).useString("details")), 1) ]; } }), _: 1 }, _parent)); } _push(``); }; } }); const _sfc_setup$1 = _sfc_main$1.setup; _sfc_main$1.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/Cards/CustomerCard.vue"); return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0; }; const CustomerCard = Object.assign(_sfc_main$1, { __name: "CardsCustomerCard" }); const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "CustomerCardSkeleton", __ssrInlineRender: true, setup(__props) { const isLoaded = ref(false); const skeletonRatio = ref(null); const skeletonSize = reactive( useElementSize(skeletonRatio, { width: 0, height: 0 }, { box: "border-box" }) ); return (_ctx, _push, _parent, _attrs) => { if (isLoaded.value) { _push(``); _push(ssrRenderComponent(unref(ContentLoader), { width: skeletonSize.width, height: "70" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(``); } else { return [ createVNode("circle", { cx: "30", cy: "30", r: "30" }), createVNode("rect", { x: "80", y: "20", rx: "3", ry: "3", width: "170", height: "20" }), createVNode("rect", { x: skeletonSize.width - 80, y: "15", rx: "3", ry: "3", width: "80", height: "30" }, null, 8, ["x"]) ]; } }), _: 1 }, _parent)); _push(``); } else { _push(``); } }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/Cards/CustomerCardSkeleton.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; const CustomerCardSkeleton = Object.assign(_sfc_main, { __name: "CardsCustomerCardSkeleton" }); export { CustomerCard as C, CustomerCardSkeleton as a }; //# sourceMappingURL=CustomerCardSkeleton-BFfLLCNN.mjs.map