Submit message button
This commit is contained in:
@@ -1,23 +1,10 @@
|
||||
'use client';
|
||||
import { useEffect } from 'react';
|
||||
import { useFormState, useFormStatus } from 'react-dom';
|
||||
import { useFormState } from 'react-dom';
|
||||
import { useSession } from 'next-auth/react';
|
||||
import { toast } from 'react-toastify';
|
||||
import addMessage from '@/app/actions/addMessage';
|
||||
import { FaPaperPlane } from 'react-icons/fa';
|
||||
|
||||
const SubmitMessageButton = () => {
|
||||
const status = useFormStatus();
|
||||
return (
|
||||
<button
|
||||
className='bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded-full w-full focus:outline-none focus:shadow-outline flex items-center justify-center'
|
||||
type='submit'
|
||||
>
|
||||
<FaPaperPlane className='mr-2' />{' '}
|
||||
{status.pending ? 'Sending...' : 'Send Message'}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
import SubmitMessageButton from './SubmitMessageButton';
|
||||
|
||||
const PropertyContactForm = ({ property }) => {
|
||||
const { data: session } = useSession();
|
||||
|
||||
Reference in New Issue
Block a user