100 lines
6.4 KiB
JavaScript
100 lines
6.4 KiB
JavaScript
import { ref, mergeProps, unref, useSSRContext } from 'vue';
|
|
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderAttr, ssrIncludeBooleanAttr, ssrInterpolate } from 'vue/server-renderer';
|
|
import { Loader2, AlertCircle, Check } from 'lucide-vue-next';
|
|
import { u as useAuthStore } from './server.mjs';
|
|
import { u as useHead } from './composables-CK-Mp9jS.mjs';
|
|
import '../nitro/nitro.mjs';
|
|
import 'node:http';
|
|
import 'node:https';
|
|
import 'node:events';
|
|
import 'node:buffer';
|
|
import 'node:fs';
|
|
import 'node:path';
|
|
import 'node:crypto';
|
|
import 'node:url';
|
|
import '../routes/renderer.mjs';
|
|
import 'vue-bundle-renderer/runtime';
|
|
import 'unhead/server';
|
|
import 'devalue';
|
|
import 'unhead/utils';
|
|
import 'pinia';
|
|
import 'vue-router';
|
|
|
|
const _sfc_main = {
|
|
__name: "profil",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
useAuthStore();
|
|
const isLoading = ref(true);
|
|
const isSaving = ref(false);
|
|
const errorMessage = ref("");
|
|
const successMessage = ref("");
|
|
const formData = ref({
|
|
name: "",
|
|
email: "",
|
|
phone: ""
|
|
});
|
|
const passwordData = ref({
|
|
current: "",
|
|
new: "",
|
|
confirm: ""
|
|
});
|
|
useHead({
|
|
title: "Mein Profil - Harheimer TC"
|
|
});
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "min-h-full py-16 bg-gray-50" }, _attrs))}><div class="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8"><h1 class="text-4xl sm:text-5xl font-display font-bold text-gray-900 mb-6"> Mein Profil </h1><div class="w-24 h-1 bg-primary-600 mb-8"></div><div class="bg-white rounded-xl shadow-lg p-8 border border-gray-100">`);
|
|
if (isLoading.value) {
|
|
_push(`<div class="flex items-center justify-center py-12">`);
|
|
_push(ssrRenderComponent(unref(Loader2), {
|
|
size: 40,
|
|
class: "animate-spin text-primary-600"
|
|
}, null, _parent));
|
|
_push(`</div>`);
|
|
} else {
|
|
_push(`<form class="space-y-6"><div><label for="name" class="block text-sm font-medium text-gray-700 mb-2"> Name </label><input id="name"${ssrRenderAttr("value", formData.value.name)} type="text" required class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"${ssrIncludeBooleanAttr(isSaving.value) ? " disabled" : ""}></div><div><label for="email" class="block text-sm font-medium text-gray-700 mb-2"> E-Mail-Adresse </label><input id="email"${ssrRenderAttr("value", formData.value.email)} type="email" required class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"${ssrIncludeBooleanAttr(isSaving.value) ? " disabled" : ""}></div><div><label for="phone" class="block text-sm font-medium text-gray-700 mb-2"> Telefonnummer </label><input id="phone"${ssrRenderAttr("value", formData.value.phone)} type="tel" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"${ssrIncludeBooleanAttr(isSaving.value) ? " disabled" : ""}></div><div class="border-t border-gray-200 pt-6 mt-6"><h3 class="text-lg font-semibold text-gray-900 mb-4">Passwort ändern</h3><div class="space-y-4"><div><label for="currentPassword" class="block text-sm font-medium text-gray-700 mb-2"> Aktuelles Passwort </label><input id="currentPassword"${ssrRenderAttr("value", passwordData.value.current)} type="password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"${ssrIncludeBooleanAttr(isSaving.value) ? " disabled" : ""}></div><div><label for="newPassword" class="block text-sm font-medium text-gray-700 mb-2"> Neues Passwort </label><input id="newPassword"${ssrRenderAttr("value", passwordData.value.new)} type="password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"${ssrIncludeBooleanAttr(isSaving.value) ? " disabled" : ""}></div><div><label for="confirmPassword" class="block text-sm font-medium text-gray-700 mb-2"> Passwort bestätigen </label><input id="confirmPassword"${ssrRenderAttr("value", passwordData.value.confirm)} type="password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"${ssrIncludeBooleanAttr(isSaving.value) ? " disabled" : ""}></div></div></div>`);
|
|
if (errorMessage.value) {
|
|
_push(`<div class="flex items-center p-3 rounded-md bg-red-50 text-red-700 text-sm">`);
|
|
_push(ssrRenderComponent(unref(AlertCircle), {
|
|
size: 20,
|
|
class: "mr-2"
|
|
}, null, _parent));
|
|
_push(` ${ssrInterpolate(errorMessage.value)}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
if (successMessage.value) {
|
|
_push(`<div class="flex items-center p-3 rounded-md bg-green-50 text-green-700 text-sm">`);
|
|
_push(ssrRenderComponent(unref(Check), {
|
|
size: 20,
|
|
class: "mr-2"
|
|
}, null, _parent));
|
|
_push(` ${ssrInterpolate(successMessage.value)}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<div class="flex justify-end space-x-4"><button type="button" class="px-6 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors"${ssrIncludeBooleanAttr(isSaving.value) ? " disabled" : ""}> Zurücksetzen </button><button type="submit" class="px-6 py-2 bg-primary-600 hover:bg-primary-700 text-white font-semibold rounded-lg transition-colors flex items-center"${ssrIncludeBooleanAttr(isSaving.value) ? " disabled" : ""}>`);
|
|
if (isSaving.value) {
|
|
_push(ssrRenderComponent(unref(Loader2), {
|
|
size: 20,
|
|
class: "animate-spin mr-2"
|
|
}, null, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<span>${ssrInterpolate(isSaving.value ? "Speichert..." : "Speichern")}</span></button></div></form>`);
|
|
}
|
|
_push(`</div></div></div>`);
|
|
};
|
|
}
|
|
};
|
|
const _sfc_setup = _sfc_main.setup;
|
|
_sfc_main.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/mitgliederbereich/profil.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
|
|
export { _sfc_main as default };
|
|
//# sourceMappingURL=profil-UUfhNGZ3.mjs.map
|