Enable admin user removals and invitation UX polish
This commit is contained in:
parent
aa12ebfe0a
commit
05f5af5ba6
5 changed files with 288 additions and 17 deletions
|
|
@ -53,6 +53,16 @@ function statusVariant(status: InviteStatus) {
|
|||
return "outline"
|
||||
}
|
||||
|
||||
function roleLabel(role: RoleOption) {
|
||||
const labels: Record<RoleOption, string> = {
|
||||
admin: "Administrador",
|
||||
manager: "Gestor",
|
||||
agent: "Agente",
|
||||
collaborator: "Colaborador",
|
||||
}
|
||||
return labels[role] ?? role
|
||||
}
|
||||
|
||||
export function InviteAcceptForm({ invite }: { invite: InviteSummary }) {
|
||||
const router = useRouter()
|
||||
const [name, setName] = useState(invite.name ?? "")
|
||||
|
|
@ -105,7 +115,7 @@ export function InviteAcceptForm({ invite }: { invite: InviteSummary }) {
|
|||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="flex flex-col items-center gap-3 text-center">
|
||||
<Badge variant={statusVariant(invite.status)} className="rounded-full px-3 py-1 text-xs uppercase tracking-wide">
|
||||
<Badge variant={statusVariant(invite.status)} className="rounded-full px-3 py-1 text-xs font-medium">
|
||||
{statusLabel(invite.status)}
|
||||
</Badge>
|
||||
<div className="space-y-1">
|
||||
|
|
@ -113,7 +123,7 @@ export function InviteAcceptForm({ invite }: { invite: InviteSummary }) {
|
|||
Convite direcionado para <span className="font-semibold text-neutral-900">{invite.email}</span>
|
||||
</p>
|
||||
<p className="text-xs text-neutral-500">
|
||||
Papel previsto: <span className="uppercase text-neutral-700">{invite.role}</span> • Tenant: <span className="uppercase text-neutral-700">{invite.tenantId}</span>
|
||||
Acesso: <span className="text-neutral-700">{roleLabel(invite.role)}</span> • Espaço: <span className="text-neutral-700">{invite.tenantId}</span>
|
||||
</p>
|
||||
<p className="text-xs text-neutral-500">Válido até {formattedExpiry}</p>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue