MCPcopy Create free account
hub / github.com/R44VC0RP/opencode.cafe / handleSubmit

Function handleSubmit

components/comments/comment-form.tsx:33–53  ·  view source on GitHub ↗
(e: React.FormEvent)

Source from the content-addressed store, hash-verified

31 const addComment = useMutation(api.comments.add)
32
33 const handleSubmit = async (e: React.FormEvent) => {
34 e.preventDefault()
35 if (!content.trim()) return
36
37 setIsSubmitting(true)
38 setError(null)
39
40 try {
41 await addComment({
42 extensionId,
43 parentId,
44 content: content.trim(),
45 })
46 setContent("")
47 onSuccess?.()
48 } catch (err) {
49 setError(err instanceof Error ? err.message : "Failed to post comment")
50 } finally {
51 setIsSubmitting(false)
52 }
53 }
54
55 return (
56 <form onSubmit={handleSubmit} className="flex flex-col gap-3">

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected