fix: add missing HQWaitingForInputSection component to fix broken test import
The HQSections.test.tsx imported HQWaitingForInputSection which was missing after phase branch merges. The component was referenced in tests but never created, causing the entire test file to fail with an import resolution error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
69
apps/web/src/components/hq/HQWaitingForInputSection.tsx
Normal file
69
apps/web/src/components/hq/HQWaitingForInputSection.tsx
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import { useNavigate } from '@tanstack/react-router'
|
||||||
|
import { Card } from '@/components/ui/card'
|
||||||
|
import { Button } from '@/components/ui/button'
|
||||||
|
import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '@/components/ui/tooltip'
|
||||||
|
import { formatRelativeTime } from '@/lib/utils'
|
||||||
|
import type { WaitingForInputItem } from './types'
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
items: WaitingForInputItem[]
|
||||||
|
}
|
||||||
|
|
||||||
|
const TRUNCATE_LENGTH = 120
|
||||||
|
|
||||||
|
export function HQWaitingForInputSection({ items }: Props) {
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="space-y-3">
|
||||||
|
<h2 className="text-sm font-medium text-muted-foreground uppercase tracking-wide">
|
||||||
|
Waiting for Input
|
||||||
|
</h2>
|
||||||
|
<div className="space-y-2">
|
||||||
|
{items.map((item) => {
|
||||||
|
const isTruncated = item.questionText.length > TRUNCATE_LENGTH
|
||||||
|
const displayText = isTruncated
|
||||||
|
? item.questionText.slice(0, TRUNCATE_LENGTH) + '…'
|
||||||
|
: item.questionText
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card key={item.agentId} className="p-4 flex items-center justify-between gap-4">
|
||||||
|
<div className="min-w-0 flex-1">
|
||||||
|
<p className="font-semibold text-sm">
|
||||||
|
{item.agentName}
|
||||||
|
{item.initiativeId && item.initiativeName && (
|
||||||
|
<span className="font-normal text-muted-foreground"> · {item.initiativeName}</span>
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<TooltipProvider>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger asChild>
|
||||||
|
<p className="text-sm text-muted-foreground mt-1 cursor-default">
|
||||||
|
{displayText}
|
||||||
|
</p>
|
||||||
|
</TooltipTrigger>
|
||||||
|
{isTruncated && (
|
||||||
|
<TooltipContent forceMount>
|
||||||
|
{item.questionText}
|
||||||
|
</TooltipContent>
|
||||||
|
)}
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
<p className="text-xs text-muted-foreground mt-1">
|
||||||
|
waiting {formatRelativeTime(item.waitingSince)}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<Button
|
||||||
|
variant="default"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => navigate({ to: '/inbox' })}
|
||||||
|
>
|
||||||
|
Answer
|
||||||
|
</Button>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user