feat(governance): Integrate ReportButton across UI

- Add ReportButton to CityRoomView header
- Add ReportButton to AgentCabinet header
- Add GOVERNANCE link to main Navigation
- Import Shield icon from lucide-react
This commit is contained in:
Apple
2025-11-29 16:18:43 -08:00
parent 91a4c6be5b
commit 2008332ce1
3 changed files with 27 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
import { Link, useLocation } from 'react-router-dom'; import { Link, useLocation } from 'react-router-dom';
import { Home, Settings, Zap, Network, Activity, Users, MessageSquare, Globe, Plus } from 'lucide-react'; import { Home, Settings, Zap, Network, Activity, Users, MessageSquare, Globe, Plus, Shield } from 'lucide-react';
export function Navigation() { export function Navigation() {
const location = useLocation(); const location = useLocation();
@@ -8,6 +8,7 @@ export function Navigation() {
{ path: '/', label: 'Головна', icon: Home }, { path: '/', label: 'Головна', icon: Home },
{ path: '/console', label: 'Console', icon: Settings }, { path: '/console', label: 'Console', icon: Settings },
{ path: '/nodes', label: 'НОДИ', icon: Network }, { path: '/nodes', label: 'НОДИ', icon: Network },
{ path: '/governance', label: 'GOVERNANCE', icon: Shield },
{ path: '/space', label: 'КОСМОС', icon: Zap }, { path: '/space', label: 'КОСМОС', icon: Zap },
{ path: '/network', label: 'МЕРЕЖА', icon: Globe }, { path: '/network', label: 'МЕРЕЖА', icon: Globe },
{ path: '/connect-node', label: 'ПІДКЛЮЧИТИ', icon: Plus }, { path: '/connect-node', label: 'ПІДКЛЮЧИТИ', icon: Plus },

View File

@@ -6,6 +6,7 @@ import { VisibilityCard } from './components/VisibilityCard';
import { AgentChatWidget } from './components/AgentChatWidget'; import { AgentChatWidget } from './components/AgentChatWidget';
import { MicroDaoWizard } from './components/MicroDaoWizard'; import { MicroDaoWizard } from './components/MicroDaoWizard';
import { GovernanceLevelBadge } from '../governance/components/GovernanceLevelBadge'; import { GovernanceLevelBadge } from '../governance/components/GovernanceLevelBadge';
import { ReportButton } from '../governance/components/ReportButton';
import { governanceApi } from '../../api/governance'; import { governanceApi } from '../../api/governance';
import { GOV_LEVEL_LABELS, POWER_LABELS } from '../../types/governance'; import { GOV_LEVEL_LABELS, POWER_LABELS } from '../../types/governance';
import type { AgentGovLevel, GovernancePower } from '../../types/governance'; import type { AgentGovLevel, GovernancePower } from '../../types/governance';
@@ -104,6 +105,13 @@ export function AgentCabinet() {
</div> </div>
<div className="flex gap-2"> <div className="flex gap-2">
<ReportButton
targetScopeType="agent"
targetScopeId={profile.agent_id}
actorDaisId="dais-demo-user"
variant="icon"
className="border border-gray-300 hover:border-red-300"
/>
<button <button
onClick={refetch} onClick={refetch}
className="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50 text-gray-700" className="px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50 text-gray-700"

View File

@@ -14,6 +14,7 @@ import {
} from '../../../api/cityRooms'; } from '../../../api/cityRooms';
import { WebSocketClient } from '../../../lib/ws'; import { WebSocketClient } from '../../../lib/ws';
import { RoomBrandHeader } from '../../microdao/components/RoomBrandHeader'; import { RoomBrandHeader } from '../../microdao/components/RoomBrandHeader';
import { ReportButton } from '../../governance/components/ReportButton';
export function CityRoomView() { export function CityRoomView() {
const { roomId } = useParams<{ roomId: string }>(); const { roomId } = useParams<{ roomId: string }>();
@@ -134,12 +135,21 @@ export function CityRoomView() {
microdaoName={room.microdao_name} microdaoName={room.microdao_name}
membersCount={room.members_online} membersCount={room.members_online}
> >
<div className="flex items-center gap-2">
<button <button
onClick={() => navigate('/city/rooms')} onClick={() => navigate('/city/rooms')}
className="text-white/80 hover:text-white flex items-center gap-2 bg-black/20 px-3 py-1.5 rounded-lg backdrop-blur-sm hover:bg-black/30 transition-all" className="text-white/80 hover:text-white flex items-center gap-2 bg-black/20 px-3 py-1.5 rounded-lg backdrop-blur-sm hover:bg-black/30 transition-all"
> >
Назад Назад
</button> </button>
<ReportButton
targetScopeType="room"
targetScopeId={roomId || ''}
actorDaisId="dais-demo-user"
variant="icon"
className="bg-black/20 hover:bg-red-500/30 backdrop-blur-sm"
/>
</div>
</RoomBrandHeader> </RoomBrandHeader>
{/* Messages */} {/* Messages */}