diff --git a/src/components/portal/portal-ticket-detail.tsx b/src/components/portal/portal-ticket-detail.tsx index 6941b2c..353e8f9 100644 --- a/src/components/portal/portal-ticket-detail.tsx +++ b/src/components/portal/portal-ticket-detail.tsx @@ -17,7 +17,7 @@ import { Button } from "@/components/ui/button" 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 { RichTextEditor } from "@/components/ui/textarea" +// removed wrong import; RichTextEditor comes from rich-text-editor import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { sanitizeEditorHtml, RichTextEditor } from "@/components/ui/rich-text-editor" @@ -67,7 +67,7 @@ interface PortalTicketDetailProps { } export function PortalTicketDetail({ ticketId }: PortalTicketDetailProps) { - const { convexUserId, session } = useAuth() + const { convexUserId, session, isCustomer } = useAuth() const addComment = useMutation(api.tickets.addComment) const [comment, setComment] = useState(""); const [attachments, setAttachments] = useState>([]) @@ -159,14 +159,16 @@ export function PortalTicketDetail({ ticketId }: PortalTicketDetailProps) { {statusLabel[ticket.status]} - - {priorityLabel[ticket.priority]} - + {!isCustomer ? ( + + {priorityLabel[ticket.priority]} + + ) : null} - + {isCustomer ? null : } {ticket.assignee ? ( @@ -186,7 +188,28 @@ 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 + + setComment(html)} + placeholder="Descreva o que aconteceu, envie atualizações ou compartilhe novas informações." + className="rounded-2xl border border-slate-200 shadow-sm focus-within:border-neutral-900 focus-within:ring-neutral-900/20" + /> +
+ setAttachments((prev) => [...prev, ...files])} + className="rounded-xl border border-dashed border-slate-300 bg-slate-50 px-3 py-4 text-sm text-neutral-600 shadow-inner" + /> +

Máximo 10MB • Até 5 arquivos

+
+
+ +
+
{ticket.comments.length === 0 ? (