Loheide-eu-mitarbeiterplatt.../resources/js/pagebuilder/blocks/WidgetBlock.vue
Friederich Loheide 2c96fcce1c
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 5m21s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m55s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m40s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m42s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m25s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m34s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m14s
Startseite frei gestalten, Neuigkeiten-Block mit Kategorien-Filter (0.26.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 09:38:18 +00:00

22 lines
1.1 KiB
Vue
Raw 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 { computed, inject } from 'vue';
import { LayoutDashboard } from '@lucide/vue';
import { widgetComponent } from '@/lib/widgets';
/**
* Block „Kachel“ der frei gestalteten Startseite: zeigt eine Startseiten-Kachel
* mit den Daten der angemeldeten Person.
*/
const props = defineProps({ block: { type: Object, required: true } });
const editing = inject('pagebuilder:editing', computed(() => false));
const component = computed(() => (props.block.props?.component ? widgetComponent(props.block.props.component) : null));
</script>
<template>
<component :is="component" v-if="component" v-bind="block.props.props" class="min-w-0" :class="{ 'pointer-events-none select-none': editing }" />
<div v-else-if="editing" class="flex items-center gap-2 rounded-md border border-dashed p-4 text-sm text-muted-foreground">
<LayoutDashboard class="size-4 shrink-0" />
{{ block.data.widget ? 'Diese Kachel ist für Sie gerade leer oder ausgeblendet – andere sehen sie womöglich.' : 'Bitte rechts eine Kachel auswählen.' }}
</div>
</template>