Add creator role buttons to admin user management

This commit is contained in:
Dan committed 2026-06-29 14:10:55 +00:00
1 parent ed30020b6c
commit a772c23559
1 file changed
+11 -16
+11 -16
View File
@@ -90,30 +90,25 @@ export default function AdminUsers({
Unsuspend
</button>
) : null}
{u.role === "learner" ? (
{u.role !== "admin" && (
<button className="btn ghost" style={btn} disabled={busy} onClick={() => act(u.id, "role", "admin")}>
Make admin
</button>
) : (
)}
{u.role !== "creator" && (
<button
className="btn ghost"
style={btn}
disabled={busy || isLastAdmin}
title={isLastAdmin ? "Can't demote the only admin" : undefined}
onClick={() => act(u.id, "role", "learner")}
onClick={() => act(u.id, "role", "creator")}
>
Make learner
Make creator
</button>
)}
</div>
</td>
</tr>
);
})}
</tbody>
</table>
</div>
);
}
const btn: React.CSSProperties = { minHeight: 36, padding: "6px 12px", fontSize: "0.85rem", boxShadow: "none" };
{u.role !== "learner" && (
<button
className="btn ghost"
style={btn}
disabled={busy || isLastAdmin}