roles update

This commit is contained in:
lendry
2026-06-25 15:14:50 +03:00
parent 9671fe458b
commit 1c55c871fc
21 changed files with 721 additions and 93 deletions

View File

@@ -1,6 +1,6 @@
'use client';
import { Copy, ExternalLink, KeyRound, RefreshCw } from 'lucide-react';
import { Copy, ExternalLink, KeyRound, RefreshCw, Trash2 } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { OAuthClient } from '@/lib/api';
@@ -27,7 +27,8 @@ export function OAuthClientDetailDialog({
onOpenChange,
onCopy,
onRotateSecret,
onToggleActive
onToggleActive,
onDelete
}: {
client: OAuthClient | null;
endpoints: OAuthEndpoints;
@@ -36,6 +37,7 @@ export function OAuthClientDetailDialog({
onCopy: (value: string, label: string) => void;
onRotateSecret: (clientId: string) => void;
onToggleActive: (client: OAuthClient) => void;
onDelete: (client: OAuthClient) => void;
}) {
if (!client) return null;
@@ -125,6 +127,15 @@ export function OAuthClientDetailDialog({
<Button variant="secondary" size="sm" onClick={() => onToggleActive(client)}>
{client.isActive ? 'Отключить' : 'Включить'}
</Button>
<Button
variant="secondary"
size="sm"
className="text-red-600 hover:text-red-700"
onClick={() => onDelete(client)}
>
<Trash2 className="h-4 w-4" />
Удалить
</Button>
</div>
) : null}
</div>