mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-21 18:55:16 +02:00
chat-messages: render and batch-submit multiple HITL approval cards
This commit is contained in:
parent
0fd87ccb7f
commit
1bb9f435e5
5 changed files with 160 additions and 76 deletions
|
|
@ -32,9 +32,9 @@ export const Timeline: FC<{
|
|||
isThreadRunning?: boolean;
|
||||
}> = ({ items, isThreadRunning = true }) => {
|
||||
const pendingValue = usePendingInterrupt();
|
||||
const pendingInterrupt = pendingValue?.pendingInterrupt ?? null;
|
||||
const pendingInterrupts = pendingValue?.pendingInterrupts ?? [];
|
||||
const onSubmit = pendingValue?.onSubmit;
|
||||
const hasPending = pendingInterrupt !== null;
|
||||
const hasPending = pendingInterrupts.length > 0;
|
||||
|
||||
// Apply the override here so downstream (grouping, headers, dots)
|
||||
// sees the corrected status without threading a callback. Keeps
|
||||
|
|
@ -135,9 +135,15 @@ export const Timeline: FC<{
|
|||
/>
|
||||
);
|
||||
})}
|
||||
{pendingInterrupt && onSubmit && (
|
||||
<div className="pl-5">
|
||||
<HitlApprovalCard pendingInterrupt={pendingInterrupt} onSubmit={onSubmit} />
|
||||
{hasPending && onSubmit && (
|
||||
<div className="pl-5 space-y-3">
|
||||
{pendingInterrupts.map((pi) => (
|
||||
<HitlApprovalCard
|
||||
key={pi.interruptId}
|
||||
pendingInterrupt={pi}
|
||||
onSubmit={(decisions) => onSubmit(pi.interruptId, decisions)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue