45 lines
1.3 KiB
Vue
45 lines
1.3 KiB
Vue
<script setup>
|
|
import { computed, useSlots } from 'vue';
|
|
|
|
import SectionTitle from './SectionTitle.vue';
|
|
|
|
defineEmits([
|
|
'submitted'
|
|
]);
|
|
|
|
const hasActions = computed(() => !! useSlots().actions);
|
|
</script>
|
|
|
|
<template>
|
|
<div class="md:grid md:grid-cols-3 md:gap-6">
|
|
<SectionTitle>
|
|
<template #title>
|
|
<slot name="title" />
|
|
</template>
|
|
<template #description>
|
|
<slot name="description" />
|
|
</template>
|
|
</SectionTitle>
|
|
|
|
<div class="mt-5 md:mt-0 md:col-span-2">
|
|
<form @submit.prevent="$emit('submitted')" class="bg-page dark:bg-page-dark text-page-on dark:text-page-dark-on shadow sm:rounded-lg">
|
|
<div
|
|
class="px-4 py-5 sm:p-6"
|
|
:class="hasActions ? 'sm:rounded-tl-md sm:rounded-tr-md' : 'sm:rounded-md'"
|
|
>
|
|
<div class="grid grid-cols-6 gap-6">
|
|
<slot name="form" />
|
|
</div>
|
|
</div>
|
|
|
|
<div
|
|
v-if="hasActions"
|
|
class="flex items-center justify-end px-4 py-3 text-right sm:px-6 shadow sm:rounded-bl-md sm:rounded-br-md"
|
|
>
|
|
<slot name="actions" />
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</template>
|