diff --git a/src/components/automations/automation-editor-dialog.tsx b/src/components/automations/automation-editor-dialog.tsx index 7494697..383f2bf 100644 --- a/src/components/automations/automation-editor-dialog.tsx +++ b/src/components/automations/automation-editor-dialog.tsx @@ -15,7 +15,7 @@ import { Checkbox } from "@/components/ui/checkbox" import { DialogClose, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" +import { Select, SelectContent, SelectEmptyState, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Separator } from "@/components/ui/separator" import { Switch } from "@/components/ui/switch" import { Textarea } from "@/components/ui/textarea" @@ -689,11 +689,19 @@ export function AutomationEditorDialog({ - {(companies ?? []).map((company) => ( - - {company.name} - - ))} + {(companies ?? []).length === 0 ? ( + + ) : ( + (companies ?? []).map((company) => ( + + {company.name} + + )) + )} ) : c.field === "queueId" ? ( @@ -707,11 +715,19 @@ export function AutomationEditorDialog({ - {(queues ?? []).map((queue) => ( - - {queue.name} - - ))} + {(queues ?? []).length === 0 ? ( + + ) : ( + (queues ?? []).map((queue) => ( + + {queue.name} + + )) + )} ) : c.field === "categoryId" ? ( @@ -725,11 +741,19 @@ export function AutomationEditorDialog({ - {(categories ?? []).map((cat) => ( - - {cat.name} - - ))} + {(categories ?? []).length === 0 ? ( + + ) : ( + (categories ?? []).map((cat) => ( + + {cat.name} + + )) + )} ) : c.field === "subcategoryId" ? ( @@ -743,11 +767,19 @@ export function AutomationEditorDialog({ - {subcategoryOptions.map((sub) => ( - - {sub.name} - - ))} + {subcategoryOptions.length === 0 ? ( + + ) : ( + subcategoryOptions.map((sub) => ( + + {sub.name} + + )) + )} ) : ( @@ -764,12 +796,22 @@ export function AutomationEditorDialog({ - Nenhum - {(templates ?? []).map((tpl) => ( - - {tpl.label} - - ))} + {(templates ?? []).length === 0 ? ( + + ) : ( + <> + Nenhum + {(templates ?? []).map((tpl) => ( + + {tpl.label} + + ))} + + )} )} @@ -890,11 +932,19 @@ export function AutomationEditorDialog({ - {(queues ?? []).map((queue) => ( - - {queue.name} - - ))} + {(queues ?? []).length === 0 ? ( + + ) : ( + (queues ?? []).map((queue) => ( + + {queue.name} + + )) + )} ) : a.type === "ASSIGN_TO" ? ( @@ -908,11 +958,19 @@ export function AutomationEditorDialog({ - {(agents ?? []).map((u) => ( - - {u.name} - - ))} + {(agents ?? []).length === 0 ? ( + + ) : ( + (agents ?? []).map((u) => ( + + {u.name} + + )) + )} ) : a.type === "SET_FORM_TEMPLATE" ? ( @@ -929,12 +987,22 @@ export function AutomationEditorDialog({ - Nenhum - {(templates ?? []).map((tpl) => ( - - {tpl.label} - - ))} + {(templates ?? []).length === 0 ? ( + + ) : ( + <> + Nenhum + {(templates ?? []).map((tpl) => ( + + {tpl.label} + + ))} + + )} ) : a.type === "SET_CHAT_ENABLED" ? ( @@ -959,12 +1027,20 @@ export function AutomationEditorDialog({ - {(checklistTemplates ?? []).map((tpl) => ( - - {tpl.name} - {tpl.company ? ` — ${tpl.company.name}` : ""} - - ))} + {(checklistTemplates ?? []).length === 0 ? ( + + ) : ( + (checklistTemplates ?? []).map((tpl) => ( + + {tpl.name} + {tpl.company ? ` — ${tpl.company.name}` : ""} + + )) + )} ) : a.type === "SEND_EMAIL" ? ( @@ -1040,12 +1116,22 @@ export function AutomationEditorDialog({ - Nenhum - {(agents ?? []).map((u) => ( - - {u.name} - - ))} + {(agents ?? []).length === 0 ? ( + + ) : ( + <> + Nenhum + {(agents ?? []).map((u) => ( + + {u.name} + + ))} + + )} diff --git a/src/components/automations/automations-manager.tsx b/src/components/automations/automations-manager.tsx index 7e2a4d5..0f42781 100644 --- a/src/components/automations/automations-manager.tsx +++ b/src/components/automations/automations-manager.tsx @@ -240,13 +240,13 @@ export function AutomationsManager() {
- - + + - - - + + + diff --git a/src/components/tickets/new-ticket-dialog.tsx b/src/components/tickets/new-ticket-dialog.tsx index a025f79..1da5ddf 100644 --- a/src/components/tickets/new-ticket-dialog.tsx +++ b/src/components/tickets/new-ticket-dialog.tsx @@ -964,8 +964,8 @@ export function NewTicketDialog({ renderValue={(option) => { if (!option) return Selecionar solicitante return ( -
-
+
+
{option.label} {option.description ? ( {option.description} @@ -974,7 +974,7 @@ export function NewTicketDialog({ {selectedCompanyOption && selectedCompanyOption.id !== NO_COMPANY_VALUE ? ( {selectedCompanyOption.name} diff --git a/src/components/tickets/ticket-checklist-card.tsx b/src/components/tickets/ticket-checklist-card.tsx index cf62f04..7dc5cca 100644 --- a/src/components/tickets/ticket-checklist-card.tsx +++ b/src/components/tickets/ticket-checklist-card.tsx @@ -200,6 +200,7 @@ export function TicketChecklistCard({