Build post chat and attachment workflows
All checks were successful
CI / backend (push) Successful in 13m8s
CI / frontend (push) Successful in 10m46s
CI / docker (push) Successful in 2m59s

This commit is contained in:
Cauê Faleiros
2026-06-08 16:44:33 -03:00
parent 8c7e5fbbe4
commit 0b920da187
30 changed files with 3021 additions and 204 deletions

View File

@@ -26,6 +26,7 @@ export function UsersView({ clients }: UsersViewProps) {
const [role, setRole] = useState<Invitation["role"]>("agency_user");
const [clientId, setClientId] = useState("");
const [createdURL, setCreatedURL] = useState("");
const [inviteStatus, setInviteStatus] = useState("");
const [isLoading, setIsLoading] = useState(false);
const [isSubmitting, setIsSubmitting] = useState(false);
const [error, setError] = useState("");
@@ -59,6 +60,7 @@ export function UsersView({ clients }: UsersViewProps) {
setIsSubmitting(true);
setError("");
setCreatedURL("");
setInviteStatus("");
try {
const invitation = await createInvitation(token, {
email,
@@ -69,6 +71,11 @@ export function UsersView({ clients }: UsersViewProps) {
setEmail("");
setClientId("");
setCreatedURL(invitation.invitation_url ?? "");
setInviteStatus(
invitation.email_sent
? "Convite criado e e-mail enviado."
: invitation.email_error || "Convite criado. Configure o SMTP para enviar por e-mail ou copie o link abaixo.",
);
} catch (err) {
setError(err instanceof Error ? err.message : "Não foi possível criar o convite.");
} finally {
@@ -144,6 +151,12 @@ export function UsersView({ clients }: UsersViewProps) {
</Button>
</form>
{inviteStatus && (
<div className="mt-4 rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground">
{inviteStatus}
</div>
)}
{createdURL && (
<div className="mt-4 rounded-lg border border-border bg-muted/30 p-3">
<div className="text-xs font-medium text-muted-foreground mb-2">Link do convite</div>