diff --git a/www/src/components/Demo.tsx b/www/src/components/Demo.tsx index 36b5fbb..7f6e8c5 100644 --- a/www/src/components/Demo.tsx +++ b/www/src/components/Demo.tsx @@ -2,7 +2,7 @@ import { checkProfanity } from '@/actions' import { useMutation } from '@tanstack/react-query' -import { useState } from 'react' +import { FormEvent, useState } from 'react' import { Button } from './ui/button' import { Input } from './ui/input' import { Icons } from './Icons' @@ -12,6 +12,11 @@ const Demo = () => { 'this is definitely not a swear word' ) + const handleSubmit = (e: FormEvent) => { + e.preventDefault(); + mutate({ message }); + } + const { data, mutate, isPending, error } = useMutation({ mutationKey: ['check-profanity'], mutationFn: checkProfanity, @@ -36,7 +41,7 @@ const Demo = () => {

https://vector.profanity.dev

-
+
{ -
+
{successData ? (