"use client" import * as React from 'react' import { Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerBody, } from '@open-mercato/ui/primitives/drawer' import { JsonDisplay } from '@open-mercato/ui/backend/JsonDisplay' import { SectionHeader } from '@open-mercato/ui/backend/SectionHeader' import { useT } from '@open-mercato/shared/lib/i18n/context' import type { RunView } from './types' export type AgentIoDrawerProps = { open: boolean onOpenChange: (open: boolean) => void run: RunView | null tools?: string[] } /** * Right-side panel showing the agent run's Input / Output / Tools used. * Drawer (Radix Dialog under the hood) handles Escape-to-close and * outside-click dismissal natively. */ export function AgentIoDrawer({ open, onOpenChange, run, tools }: AgentIoDrawerProps) { const t = useT() const toolList = tools && tools.length > 0 ? tools : [] return ( {t('agent_orchestrator.proposal.drawer.agentLane')} {t('agent_orchestrator.proposal.drawer.title')}
{run?.input != null ? ( ) : (

{t('agent_orchestrator.proposal.drawer.noInput')}

)}
{run?.output != null ? ( ) : (

{t('agent_orchestrator.proposal.drawer.noOutput')}

)}
{toolList.length > 0 ? (
    {toolList.map((tool) => (
  • {tool}
  • ))}
) : (

{t('agent_orchestrator.proposal.drawer.noTools')}

)}
) } export default AgentIoDrawer