Loheide-eu-mitarbeiterplatt.../resources/js/pages/DigestUnsubscribe.vue
Friederich Loheide f9922f7308
Some checks failed
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m49s
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m19s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m29s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m39s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m38s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 9m25s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 7m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m4s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 46s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m9s
Ideenbox-Moderation und Wochenüberblick per E-Mail (0.36.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 15:17:47 +00:00

33 lines
1.3 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script setup>
import { router } from '@inertiajs/vue3';
import { ref } from 'vue';
import { CircleCheck, LoaderCircle } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import GuestLayout from '@/layouts/GuestLayout.vue';
/**
* Wochenüberblick abbestellen – über den Link in der E-Mail, ohne Anmeldung.
*/
const props = defineProps({
done: { type: Boolean, default: false },
action: { type: String, required: true },
});
const finished = ref(props.done);
const busy = ref(false);
function unsubscribe() {
busy.value = true;
router.post(props.action, {}, { preserveState: true, onSuccess: () => (finished.value = true), onFinish: () => (busy.value = false) });
}
</script>
<template>
<GuestLayout title="Wochenüberblick" :description="finished ? '' : 'Möchten Sie den Wochenüberblick per E-Mail abbestellen?'">
<p v-if="finished" class="flex items-start gap-2.5 rounded-md bg-brand-soft p-4 text-sm text-brand-text">
<CircleCheck class="mt-0.5 size-4 shrink-0" />
Abbestellt. Sie bekommen keinen Wochenüberblick mehr. Im Profil lässt er sich jederzeit wieder einschalten.
</p>
<Button v-else class="h-10 w-full" :disabled="busy" @click="unsubscribe"><LoaderCircle v-if="busy" class="animate-spin" /> Abbestellen</Button>
</GuestLayout>
</template>