Status
{statusLabel[ticket.status]}
diff --git a/src/components/portal/portal-ticket-detail.tsx b/src/components/portal/portal-ticket-detail.tsx
index 427de8c..6941b2c 100644
--- a/src/components/portal/portal-ticket-detail.tsx
+++ b/src/components/portal/portal-ticket-detail.tsx
@@ -14,12 +14,12 @@ import type { TicketWithDetails } from "@/lib/schemas/ticket"
import { useAuth } from "@/lib/auth-client"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
+import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Dropzone } from "@/components/ui/dropzone"
import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@/components/ui/empty"
import { Skeleton } from "@/components/ui/skeleton"
-import { Textarea } from "@/components/ui/textarea"
+import { RichTextEditor } from "@/components/ui/textarea"
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
-import { sanitizeEditorHtml } from "@/components/ui/rich-text-editor"
+import { sanitizeEditorHtml, RichTextEditor } from "@/components/ui/rich-text-editor"
const statusLabel: Record
= {
PENDING: "Pendente",
@@ -69,7 +69,7 @@ interface PortalTicketDetailProps {
export function PortalTicketDetail({ ticketId }: PortalTicketDetailProps) {
const { convexUserId, session } = useAuth()
const addComment = useMutation(api.tickets.addComment)
- const [comment, setComment] = useState("")
+ const [comment, setComment] = useState(""); const [attachments, setAttachments] = useState>([])
const ticketRaw = useQuery(
api.tickets.getById,
@@ -133,7 +133,7 @@ export function PortalTicketDetail({ ticketId }: PortalTicketDetailProps) {
authorId: convexUserId as Id<"users">,
visibility: "PUBLIC",
body: htmlBody,
- attachments: [],
+ attachments: attachments.map((f) => ({ storageId: f.storageId as Id<"_storage">, name: f.name, size: f.size, type: f.type, })),
})
setComment("")
toast.success("Comentário enviado!", { id: toastId })
@@ -186,22 +186,7 @@ export function PortalTicketDetail({ ticketId }: PortalTicketDetailProps) {
+ \n setComment(html)}\n placeholder="Descreva o que aconteceu, envie atualizações ou compartilhe novas informações."\n className="rounded-2xl border border-slate-200 shadow-sm focus-within:border-neutral-900 focus-within:ring-neutral-900/20"\n />\n \n
setAttachments((prev) => [...prev, ...files])}\n className="rounded-xl border border-dashed border-slate-300 bg-slate-50 px-3 py-4 text-sm text-neutral-600 shadow-inner"\n />\n Máximo 10MB • Até 5 arquivos
\n \n \n \n
\n
{ticket.comments.length === 0 ? (
@@ -300,3 +285,9 @@ function DetailItem({ label, value, subtitle }: DetailItemProps) {
)
}
+
+
+
+
+
+