mirror of
https://github.com/RSSNext/Folo.git
synced 2026-10-16 20:51:43 +08:00
fix: resolve context block typings
This commit is contained in:
+2
-2
@@ -71,8 +71,8 @@ export const ContextBlock: FC<{ block: AIChatContextBlock }> = memo(({ block })
|
||||
<div className="flex items-center gap-1.5">
|
||||
<div className="relative">
|
||||
<ImageThumbnail
|
||||
previewUrl={previewUrl || dataUrl}
|
||||
originalUrl={dataUrl}
|
||||
previewUrl={previewUrl || dataUrl || ""}
|
||||
originalUrl={dataUrl || ""}
|
||||
alt={name}
|
||||
filename={name}
|
||||
className={"m-0.5 size-5 rounded-md"}
|
||||
|
||||
+3
-1
@@ -123,6 +123,8 @@ export function isImageAttachment(block: AIChatContextBlock): boolean {
|
||||
* Gets display content for file attachments based on upload status
|
||||
*/
|
||||
export function getFileDisplayContent(attachment: FileAttachment): string {
|
||||
const statusLabel = FILE_STATUS_LABELS[attachment.uploadStatus]
|
||||
const status = attachment.uploadStatus
|
||||
const statusLabel =
|
||||
status !== undefined ? FILE_STATUS_LABELS[status as keyof typeof FILE_STATUS_LABELS] : undefined
|
||||
return statusLabel || attachment.name
|
||||
}
|
||||
|
||||
@@ -202,6 +202,7 @@ export async function uploadFileAttachment(
|
||||
onProgressUpdate?.(currentAttachment)
|
||||
|
||||
const { dataUrl } = fileAttachment
|
||||
if (!dataUrl) throw new Error("Missing data URL")
|
||||
const blob = await fetch(dataUrl).then((r) => r.blob())
|
||||
|
||||
// TODO: Replace with real progress tracking when followApi supports it
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { MCPService } from "@follow/shared/settings/interface"
|
||||
import type { UpdateConnectionRequest } from "@follow-app/client-sdk"
|
||||
import type { McpConnectionInfo, UpdateConnectionRequest } from "@follow-app/client-sdk"
|
||||
|
||||
import { followApi } from "~/lib/api-client"
|
||||
|
||||
@@ -14,7 +14,11 @@ export const createMCPConnection = async (connectionData: {
|
||||
|
||||
export const fetchMCPConnections = async (): Promise<MCPService[]> => {
|
||||
const response = await followApi.mcp.getConnections()
|
||||
return response.data
|
||||
return response.data.map(
|
||||
(service: McpConnectionInfo): MCPService => ({
|
||||
...service,
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
export const updateMCPConnection = async (
|
||||
|
||||
Reference in New Issue
Block a user