<script setup lang="ts">
import AppLayout from "@/Layouts/AppLayout.vue";
import ChatInput from "@/Components/ChatInput.vue";
import {useForm} from "@inertiajs/vue3";

const form = useForm({
    message: null
})

const submit = () => {
    form.post(route('chats.store'), {
        onSuccess: () => form.reset()
    })
}

</script>

<template>
    <AppLayout page-class="mx-auto max-w-4xl flex items-center justify-center">
        <ChatInput v-model="form.message" :disabled="form.processing" @submit="submit"/>
    </AppLayout>
</template>
