tethys.backend/resources/js/Pages/Admin/Permission/Create.vue
2023-03-03 16:54:28 +01:00

73 lines
2.0 KiB
Vue

<script setup>
import { Head, Link, useForm } from "@inertiajs/vue3"
import {
mdiAccountKey,
mdiArrowLeftBoldOutline
} from "@mdi/js"
import LayoutAuthenticated from "@/Layouts/LayoutAuthenticated.vue"
import SectionMain from "@/Components/SectionMain.vue"
import SectionTitleLineWithButton from "@/Components/SectionTitleLineWithButton.vue"
import CardBox from "@/Components/CardBox.vue"
import FormField from '@/Components/FormField.vue'
import FormControl from '@/Components/FormControl.vue'
import BaseButton from '@/Components/BaseButton.vue'
import BaseButtons from '@/Components/BaseButtons.vue'
const form = useForm({
name: '',
})
</script>
<template>
<LayoutAuthenticated>
<Head title="Create permission" />
<SectionMain>
<SectionTitleLineWithButton
:icon="mdiAccountKey"
title="Add permission"
main
>
<BaseButton
:route-name="route('permission.index')"
:icon="mdiArrowLeftBoldOutline"
label="Back"
color="white"
rounded-full
small
/>
</SectionTitleLineWithButton>
<CardBox
form
@submit.prevent="form.post(route('permission.store'))"
>
<FormField
label="Name"
:class="{ 'text-red-400': form.errors.name }"
>
<FormControl
v-model="form.name"
type="text"
placeholder="Enter Name"
:error="form.errors.name"
>
<div class="text-red-400 text-sm" v-if="form.errors.name">
{{ form.errors.name }}
</div>
</FormControl>
</FormField>
<template #footer>
<BaseButtons>
<BaseButton
type="submit"
color="info"
label="Submit"
:class="{ 'opacity-25': form.processing }"
:disabled="form.processing"
/>
</BaseButtons>
</template>
</CardBox>
</SectionMain>
</LayoutAuthenticated>
</template>