Add Banned role
This commit is contained in:
@@ -102,7 +102,7 @@ export default function Users({ token }) {
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className={`p-2 rounded ${
|
||||
user.role === 'admin' ? 'bg-blue-600' : user.role === 'support' ? 'bg-purple-600' : 'bg-gray-700'
|
||||
user.role === 'admin' ? 'bg-blue-600' : user.role === 'support' ? 'bg-purple-600' : user.role === 'banned' ? 'bg-red-600' : 'bg-gray-700'
|
||||
}`}>
|
||||
{user.role === 'admin' ? (
|
||||
<Shield className="w-6 h-6" />
|
||||
@@ -113,7 +113,7 @@ export default function Users({ token }) {
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold">{user.username}</h3>
|
||||
<p className="text-sm text-gray-400">
|
||||
{user.role === 'admin' ? 'Администратор' : user.role === 'support' ? 'Тех. поддержка' : 'Пользователь'}
|
||||
{user.role === 'admin' ? 'Администратор' : user.role === 'support' ? 'Тех. поддержка' : user.role === 'banned' ? 'Забанен' : 'Пользователь'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -127,6 +127,7 @@ export default function Users({ token }) {
|
||||
<option value="user">Пользователь</option>
|
||||
<option value="support">Тех. поддержка</option>
|
||||
<option value="admin">Администратор</option>
|
||||
<option value="banned">Забанен</option>
|
||||
</select>
|
||||
<button
|
||||
onClick={() => deleteUser(user.username)}
|
||||
@@ -178,6 +179,12 @@ export default function Users({ token }) {
|
||||
Тех. поддержка имеет доступ к системе тикетов
|
||||
</p>
|
||||
)}
|
||||
|
||||
{user.role === 'banned' && (
|
||||
<p className="text-sm text-red-400">
|
||||
⛔ Пользователь заблокирован и не имеет доступа к панели
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user