240 lines
22 KiB
JavaScript
240 lines
22 KiB
JavaScript
import { _ as __nuxt_component_0 } from "./nuxt-link-1NBbHb-h.js";
|
||
import { defineComponent, computed, ref, watch, withCtx, createTextVNode, toDisplayString, useSSRContext } from "vue";
|
||
import { ssrRenderAttrs, ssrInterpolate, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrRenderComponent, ssrRenderClass } from "vue/server-renderer";
|
||
import { useRouter } from "vue-router";
|
||
import { c as useAuthStore, d as useCookie } from "../server.mjs";
|
||
import "/app/node_modules/hookable/dist/index.mjs";
|
||
import "/app/node_modules/ufo/dist/index.mjs";
|
||
import "/app/node_modules/defu/dist/defu.mjs";
|
||
import "/app/node_modules/ofetch/dist/node.mjs";
|
||
import "#internal/nuxt/paths";
|
||
import "/app/node_modules/unctx/dist/index.mjs";
|
||
import "/app/node_modules/h3/dist/index.mjs";
|
||
import "pinia";
|
||
import "/app/node_modules/klona/dist/index.mjs";
|
||
import "/app/node_modules/cookie-es/dist/index.mjs";
|
||
import "/app/node_modules/destr/dist/index.mjs";
|
||
import "/app/node_modules/ohash/dist/index.mjs";
|
||
import "/app/node_modules/@unhead/vue/dist/index.mjs";
|
||
import "@vue/devtools-api";
|
||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||
__name: "index",
|
||
__ssrInlineRender: true,
|
||
setup(__props) {
|
||
const router = useRouter();
|
||
const auth = useAuthStore();
|
||
const canViewPersons = computed(() => {
|
||
if (auth.isAdmin) return true;
|
||
return !!auth.user?.system_capabilities?.["persons:view"];
|
||
});
|
||
computed(() => {
|
||
if (auth.isAdmin) return true;
|
||
return !!auth.user?.system_capabilities?.["persons:edit"];
|
||
});
|
||
computed(() => {
|
||
if (auth.isAdmin) return true;
|
||
return !!auth.user?.system_capabilities?.["persons:merge"];
|
||
});
|
||
if (!canViewPersons.value && !auth.isAdmin) {
|
||
router.push("/");
|
||
}
|
||
const loading = ref(true);
|
||
const error = ref(null);
|
||
const persons = ref([]);
|
||
const totalCount = ref(0);
|
||
const skip = ref(0);
|
||
const limit = ref(50);
|
||
const searchQuery = ref("");
|
||
const ghostFilter = ref("all");
|
||
const activeFilter = ref("all");
|
||
const hasUserFilter = ref("all");
|
||
const mergedFilter = ref("all");
|
||
const notification = ref(null);
|
||
const activeCount = computed(() => persons.value.filter((p) => p.is_active).length);
|
||
const ghostCount = computed(() => persons.value.filter((p) => p.is_ghost).length);
|
||
const mergedCount = computed(() => persons.value.filter((p) => p.merged_into_id).length);
|
||
let searchDebounceTimer = null;
|
||
function debouncedFetchPersons() {
|
||
if (searchDebounceTimer) {
|
||
clearTimeout(searchDebounceTimer);
|
||
}
|
||
searchDebounceTimer = setTimeout(() => {
|
||
skip.value = 0;
|
||
fetchPersons();
|
||
}, 400);
|
||
}
|
||
watch(searchQuery, () => {
|
||
debouncedFetchPersons();
|
||
});
|
||
watch([ghostFilter, activeFilter, hasUserFilter, mergedFilter], () => {
|
||
skip.value = 0;
|
||
fetchPersons();
|
||
});
|
||
const isFilterActive = computed(() => {
|
||
return searchQuery.value !== "" || ghostFilter.value !== "all" || activeFilter.value !== "all" || hasUserFilter.value !== "all" || mergedFilter.value !== "all";
|
||
});
|
||
function getAuthHeaders() {
|
||
const tokenCookie = useCookie("access_token");
|
||
const token = tokenCookie.value;
|
||
return token ? { Authorization: `Bearer ${token}` } : {};
|
||
}
|
||
async function fetchPersons() {
|
||
loading.value = true;
|
||
error.value = null;
|
||
try {
|
||
const params = { skip: skip.value, limit: limit.value };
|
||
if (searchQuery.value) {
|
||
params.search = searchQuery.value;
|
||
}
|
||
if (ghostFilter.value !== "all") {
|
||
params.is_ghost = ghostFilter.value === "yes";
|
||
}
|
||
if (activeFilter.value !== "all") {
|
||
params.is_active = activeFilter.value === "active";
|
||
}
|
||
if (hasUserFilter.value !== "all") {
|
||
params.has_user = hasUserFilter.value === "yes";
|
||
}
|
||
if (mergedFilter.value !== "all") {
|
||
params.is_merged = mergedFilter.value === "yes";
|
||
}
|
||
const response = await $fetch("/api/v1/admin/persons", {
|
||
params,
|
||
headers: getAuthHeaders()
|
||
});
|
||
persons.value = response.items;
|
||
totalCount.value = response.total;
|
||
} catch (err) {
|
||
console.error("[Persons] Failed to fetch persons:", err);
|
||
error.value = err?.data?.detail || err?.message || "Failed to load persons";
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
function roleBadgeClass(role) {
|
||
const r = (role || "").toLowerCase();
|
||
if (r === "superadmin") return "bg-purple-500/20 text-purple-300";
|
||
if (r === "admin") return "bg-indigo-500/20 text-indigo-300";
|
||
if (r === "staff") return "bg-cyan-500/20 text-cyan-300";
|
||
return "bg-slate-500/20 text-slate-300";
|
||
}
|
||
function formatDate(dateStr) {
|
||
if (!dateStr) return "—";
|
||
try {
|
||
const d = new Date(dateStr);
|
||
return d.toLocaleDateString("hu-HU", {
|
||
year: "numeric",
|
||
month: "short",
|
||
day: "numeric"
|
||
});
|
||
} catch {
|
||
return dateStr;
|
||
}
|
||
}
|
||
return (_ctx, _push, _parent, _attrs) => {
|
||
const _component_NuxtLink = __nuxt_component_0;
|
||
_push(`<div${ssrRenderAttrs(_attrs)}><div class="mb-8"><h1 class="text-2xl font-bold text-white">${ssrInterpolate(_ctx.$t("persons.title"))}</h1><p class="text-slate-400 mt-1">${ssrInterpolate(_ctx.$t("persons.subtitle"))}</p></div><div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6"><div class="relative flex-1 max-w-md"><svg class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg><input${ssrRenderAttr("value", searchQuery.value)} type="text"${ssrRenderAttr("placeholder", _ctx.$t("persons.search_placeholder"))} class="w-full pl-10 pr-4 py-2.5 bg-slate-800 border border-slate-700 rounded-lg text-sm text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 transition"></div><div class="flex items-center gap-2 flex-wrap"><select class="px-3 py-2.5 bg-slate-800 border border-slate-700 rounded-lg text-sm text-slate-300 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"><option value="all"${ssrIncludeBooleanAttr(Array.isArray(ghostFilter.value) ? ssrLooseContain(ghostFilter.value, "all") : ssrLooseEqual(ghostFilter.value, "all")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.all_ghost_statuses"))}</option><option value="no"${ssrIncludeBooleanAttr(Array.isArray(ghostFilter.value) ? ssrLooseContain(ghostFilter.value, "no") : ssrLooseEqual(ghostFilter.value, "no")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.ghost_no"))}</option><option value="yes"${ssrIncludeBooleanAttr(Array.isArray(ghostFilter.value) ? ssrLooseContain(ghostFilter.value, "yes") : ssrLooseEqual(ghostFilter.value, "yes")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.ghost_yes"))}</option></select><select class="px-3 py-2.5 bg-slate-800 border border-slate-700 rounded-lg text-sm text-slate-300 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"><option value="all"${ssrIncludeBooleanAttr(Array.isArray(activeFilter.value) ? ssrLooseContain(activeFilter.value, "all") : ssrLooseEqual(activeFilter.value, "all")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.all_active_statuses"))}</option><option value="active"${ssrIncludeBooleanAttr(Array.isArray(activeFilter.value) ? ssrLooseContain(activeFilter.value, "active") : ssrLooseEqual(activeFilter.value, "active")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.active_yes"))}</option><option value="inactive"${ssrIncludeBooleanAttr(Array.isArray(activeFilter.value) ? ssrLooseContain(activeFilter.value, "inactive") : ssrLooseEqual(activeFilter.value, "inactive")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.active_no"))}</option></select><select class="px-3 py-2.5 bg-slate-800 border border-slate-700 rounded-lg text-sm text-slate-300 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"><option value="all"${ssrIncludeBooleanAttr(Array.isArray(hasUserFilter.value) ? ssrLooseContain(hasUserFilter.value, "all") : ssrLooseEqual(hasUserFilter.value, "all")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.all_user_statuses"))}</option><option value="yes"${ssrIncludeBooleanAttr(Array.isArray(hasUserFilter.value) ? ssrLooseContain(hasUserFilter.value, "yes") : ssrLooseEqual(hasUserFilter.value, "yes")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.has_user_yes"))}</option><option value="no"${ssrIncludeBooleanAttr(Array.isArray(hasUserFilter.value) ? ssrLooseContain(hasUserFilter.value, "no") : ssrLooseEqual(hasUserFilter.value, "no")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.has_user_no"))}</option></select><select class="px-3 py-2.5 bg-slate-800 border border-slate-700 rounded-lg text-sm text-slate-300 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 transition"><option value="all"${ssrIncludeBooleanAttr(Array.isArray(mergedFilter.value) ? ssrLooseContain(mergedFilter.value, "all") : ssrLooseEqual(mergedFilter.value, "all")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.all_merged_statuses"))}</option><option value="no"${ssrIncludeBooleanAttr(Array.isArray(mergedFilter.value) ? ssrLooseContain(mergedFilter.value, "no") : ssrLooseEqual(mergedFilter.value, "no")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.merged_no"))}</option><option value="yes"${ssrIncludeBooleanAttr(Array.isArray(mergedFilter.value) ? ssrLooseContain(mergedFilter.value, "yes") : ssrLooseEqual(mergedFilter.value, "yes")) ? " selected" : ""}>${ssrInterpolate(_ctx.$t("persons.merged_yes"))}</option></select></div></div>`);
|
||
if (loading.value) {
|
||
_push(`<div class="flex items-center justify-center py-20"><div class="flex flex-col items-center gap-3"><svg class="w-8 h-8 text-indigo-400 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg><p class="text-slate-400 text-sm">${ssrInterpolate(_ctx.$t("persons.loading"))}</p></div></div>`);
|
||
} else if (error.value) {
|
||
_push(`<div class="flex flex-col items-center justify-center py-20 text-center"><svg class="w-12 h-12 text-red-500 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg><p class="text-red-400 text-sm mb-2">${ssrInterpolate(error.value)}</p><button class="px-4 py-2 text-sm bg-indigo-600/20 text-indigo-300 hover:bg-indigo-600/30 rounded-lg transition">${ssrInterpolate(_ctx.$t("persons.retry"))}</button></div>`);
|
||
} else {
|
||
_push(`<!--[--><div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-8"><div class="bg-slate-800 rounded-xl border border-slate-700 p-4"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-indigo-500/10 text-indigo-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></div><div><p class="text-xs text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.total_persons"))}</p><p class="text-2xl font-bold text-white">${ssrInterpolate(totalCount.value)}</p></div></div></div><div class="bg-slate-800 rounded-xl border border-slate-700 p-4"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-emerald-500/10 text-emerald-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div><div><p class="text-xs text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.active_persons"))}</p><p class="text-2xl font-bold text-emerald-400">${ssrInterpolate(activeCount.value)}</p></div></div></div><div class="bg-slate-800 rounded-xl border border-slate-700 p-4"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-amber-500/10 text-amber-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"></path></svg></div><div><p class="text-xs text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.ghost_persons"))}</p><p class="text-2xl font-bold text-amber-400">${ssrInterpolate(ghostCount.value)}</p></div></div></div><div class="bg-slate-800 rounded-xl border border-slate-700 p-4"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-red-500/10 text-red-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg></div><div><p class="text-xs text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("persons.merged_persons"))}</p><p class="text-2xl font-bold text-red-400">${ssrInterpolate(mergedCount.value)}</p></div></div></div></div>`);
|
||
if (isFilterActive.value) {
|
||
_push(`<div class="mb-4 text-xs text-slate-500">${ssrInterpolate(_ctx.$t("persons.filtered_results"))}: <span class="text-slate-300 font-semibold">${ssrInterpolate(persons.value.length)}</span> / ${ssrInterpolate(totalCount.value)} db </div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"><div class="overflow-x-auto"><table class="w-full text-sm"><thead><tr class="border-b border-slate-700 bg-slate-800/80"><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">ID</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("persons.name"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("persons.phone"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("persons.birth_date"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("persons.status"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("persons.users_count"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("persons.active_user"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("persons.address"))}</th><th class="text-left py-3.5 px-4 text-xs font-semibold uppercase tracking-wider text-slate-400">${ssrInterpolate(_ctx.$t("persons.actions"))}</th></tr></thead><tbody><!--[-->`);
|
||
ssrRenderList(persons.value, (person) => {
|
||
_push(`<tr class="border-b border-slate-700/50 hover:bg-slate-700/30 transition"><td class="py-3.5 px-4 text-slate-400 font-mono text-xs">${ssrInterpolate(person.id)}</td><td class="py-3.5 px-4">`);
|
||
_push(ssrRenderComponent(_component_NuxtLink, {
|
||
to: "/persons/" + person.id,
|
||
class: "text-sm font-medium text-white hover:underline cursor-pointer hover:text-indigo-400 transition-colors"
|
||
}, {
|
||
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
||
if (_push2) {
|
||
_push2(`${ssrInterpolate(person.last_name)} ${ssrInterpolate(person.first_name)}`);
|
||
} else {
|
||
return [
|
||
createTextVNode(toDisplayString(person.last_name) + " " + toDisplayString(person.first_name), 1)
|
||
];
|
||
}
|
||
}),
|
||
_: 2
|
||
}, _parent));
|
||
_push(`</td><td class="py-3.5 px-4 text-slate-300">${ssrInterpolate(person.phone || "—")}</td><td class="py-3.5 px-4 text-slate-300 text-xs">${ssrInterpolate(formatDate(person.birth_date))}</td><td class="py-3.5 px-4"><div class="flex flex-wrap gap-1"><span class="${ssrRenderClass([person.is_active ? "bg-emerald-500/10 text-emerald-400" : "bg-amber-500/10 text-amber-400", "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium"])}"><span class="${ssrRenderClass([person.is_active ? "bg-emerald-400" : "bg-amber-400", "w-1.5 h-1.5 rounded-full mr-1.5"])}"></span> ${ssrInterpolate(person.is_active ? _ctx.$t("persons.active") : _ctx.$t("persons.inactive"))}</span>`);
|
||
if (person.is_ghost) {
|
||
_push(`<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-purple-500/20 text-purple-300">${ssrInterpolate(_ctx.$t("persons.ghost"))}</span>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
if (person.merged_into_id) {
|
||
_push(`<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-500/20 text-red-300">${ssrInterpolate(_ctx.$t("persons.merged"))}</span>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
_push(`</div></td><td class="py-3.5 px-4"><span class="text-slate-300">${ssrInterpolate(person.users_count)}</span></td><td class="py-3.5 px-4">`);
|
||
if (person.active_user) {
|
||
_push(`<div><p class="text-slate-300 text-xs">${ssrInterpolate(person.active_user.email)}</p><span class="${ssrRenderClass([roleBadgeClass(person.active_user.role), "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium"])}">${ssrInterpolate(person.active_user.role)}</span></div>`);
|
||
} else {
|
||
_push(`<span class="text-slate-500">—</span>`);
|
||
}
|
||
_push(`</td><td class="py-3.5 px-4">`);
|
||
if (person.address) {
|
||
_push(`<span class="text-slate-300 text-xs">${ssrInterpolate(person.address.full_address_text || person.address.address_city + ", " + person.address.address_street_name + " " + (person.address.address_house_number || ""))}</span>`);
|
||
} else {
|
||
_push(`<span class="text-slate-500">—</span>`);
|
||
}
|
||
_push(`</td><td class="py-3.5 px-4"><div class="flex items-center gap-2">`);
|
||
_push(ssrRenderComponent(_component_NuxtLink, {
|
||
to: "/persons/" + person.id,
|
||
class: "px-3 py-1.5 text-xs font-medium bg-slate-600/20 text-slate-300 hover:bg-slate-600/30 rounded-lg transition"
|
||
}, {
|
||
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
||
if (_push2) {
|
||
_push2(`${ssrInterpolate(_ctx.$t("persons.view"))}`);
|
||
} else {
|
||
return [
|
||
createTextVNode(toDisplayString(_ctx.$t("persons.view")), 1)
|
||
];
|
||
}
|
||
}),
|
||
_: 2
|
||
}, _parent));
|
||
_push(`</div></td></tr>`);
|
||
});
|
||
_push(`<!--]--></tbody></table></div>`);
|
||
if (persons.value.length === 0 && !loading.value) {
|
||
_push(`<div class="flex flex-col items-center justify-center py-16 text-center"><svg class="w-12 h-12 text-slate-600 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg><p class="text-slate-400 text-sm">${ssrInterpolate(_ctx.$t("persons.no_results"))}</p></div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
_push(`</div>`);
|
||
if (totalCount.value > limit.value) {
|
||
_push(`<div class="flex items-center justify-between mt-6"><p class="text-xs text-slate-500">${ssrInterpolate(_ctx.$t("persons.showing"))} ${ssrInterpolate(skip.value + 1)}–${ssrInterpolate(Math.min(skip.value + limit.value, totalCount.value))} / ${ssrInterpolate(totalCount.value)}</p><div class="flex items-center gap-2"><button${ssrIncludeBooleanAttr(skip.value === 0) ? " disabled" : ""} class="${ssrRenderClass([skip.value > 0 ? "bg-slate-700 text-slate-300 hover:bg-slate-600" : "bg-slate-800 text-slate-600", "px-3 py-1.5 text-xs font-medium rounded-lg transition disabled:opacity-30 disabled:cursor-not-allowed"])}">${ssrInterpolate(_ctx.$t("persons.prev"))}</button><button${ssrIncludeBooleanAttr(skip.value + limit.value >= totalCount.value) ? " disabled" : ""} class="${ssrRenderClass([skip.value + limit.value < totalCount.value ? "bg-slate-700 text-slate-300 hover:bg-slate-600" : "bg-slate-800 text-slate-600", "px-3 py-1.5 text-xs font-medium rounded-lg transition disabled:opacity-30 disabled:cursor-not-allowed"])}">${ssrInterpolate(_ctx.$t("persons.next"))}</button></div></div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
_push(`<!--]-->`);
|
||
}
|
||
if (notification.value) {
|
||
_push(`<div class="${ssrRenderClass([notification.value.type === "success" ? "bg-emerald-600 text-white" : "bg-red-600 text-white", "fixed bottom-6 right-6 px-5 py-3 rounded-xl shadow-xl text-sm font-medium z-50"])}">${ssrInterpolate(notification.value.message)}</div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
_push(`</div>`);
|
||
};
|
||
}
|
||
});
|
||
const _sfc_setup = _sfc_main.setup;
|
||
_sfc_main.setup = (props, ctx) => {
|
||
const ssrContext = useSSRContext();
|
||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/persons/index.vue");
|
||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
||
};
|
||
export {
|
||
_sfc_main as default
|
||
};
|
||
//# sourceMappingURL=index-CncnskcL.js.map
|