Files
portal/app/resources/js/components/errors/ErrorActions.vue
T

56 lines
1.4 KiB
Vue
Raw Normal View History

<script setup lang="ts">
/**
* ErrorActions — две кнопки (primary + опциональная secondary) для ErrorView.
* Принимает action-объекты как props; click на handler делегирует через
* вызов action.onClick() (router-link / href обрабатывается Vuetify-биндингами).
*
* Sprint 4 Phase B/3 — split ErrorView (audit O-refactor-04 закрытие).
*/
interface ErrorAction {
label: string;
icon: string;
to?: string;
href?: string;
onClick?: () => void;
}
defineProps<{
primary: ErrorAction;
secondary?: ErrorAction;
}>();
</script>
<template>
<div class="err-actions">
<v-btn
color="primary"
variant="flat"
:prepend-icon="primary.icon"
:to="primary.to"
@click="primary.onClick?.()"
>
{{ primary.label }}
</v-btn>
<v-btn
v-if="secondary"
variant="outlined"
:prepend-icon="secondary.icon"
:to="secondary.to"
:href="secondary.href"
@click="secondary.onClick?.()"
>
{{ secondary.label }}
</v-btn>
</div>
</template>
<style scoped>
.err-actions {
display: flex;
gap: 12px;
margin-bottom: 24px;
flex-wrap: wrap;
justify-content: center;
}
</style>