MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / selectReadyBlocks

Function selectReadyBlocks

packages/kilo-chat-hooks/src/use-attachment-queue.ts:105–118  ·  view source on GitHub ↗
(rows: QueuedAttachment[])

Source from the content-addressed store, hash-verified

103}
104
105export function selectReadyBlocks(rows: QueuedAttachment[]): AttachmentBlock[] {
106 return rows
107 .filter(
108 (r): r is QueuedAttachment & { attachmentId: string } =>
109 r.status === 'ready' && typeof r.attachmentId === 'string'
110 )
111 .map(r => ({
112 type: 'attachment' as const,
113 attachmentId: r.attachmentId,
114 mimeType: r.mimeType,
115 size: r.size,
116 filename: r.filename,
117 }));
118}
119
120export function selectIsUploading(rows: QueuedAttachment[]): boolean {
121 return rows.some(r => r.status === 'uploading');

Callers 2

useAttachmentQueueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected