"use client" import { useState } from "react" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Textarea } from "@/components/ui/textarea" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Send } from "lucide-react" interface NoteFormProps { leadId: string } export function NoteForm({ leadId }: NoteFormProps) { const [note, setNote] = useState("") const [submitting, setSubmitting] = useState(false) const handleSubmit = async () => { if (!note.trim()) return setSubmitting(true) try { await fetch(`/api/leads/${leadId}/notes`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ content: note }), }) setNote("") window.location.reload() } catch { // ignore } setSubmitting(false) } return ( Add Note
SC