Submit message button

This commit is contained in:
Brad Traversy
2024-07-26 09:43:28 -04:00
parent f5c034201a
commit 1789015432
2 changed files with 18 additions and 15 deletions
+16
View File
@@ -0,0 +1,16 @@
import { useFormStatus } from 'react-dom';
import { FaPaperPlane } from 'react-icons/fa';
const SubmitMessageButton = () => {
const { pending } = 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'
disabled={pending}
>
<FaPaperPlane className='mr-2' />{' '}
{pending ? 'Sending...' : 'Send Message'}
</button>
);
};