Provide the open-file handler to chat panels
This commit is contained in:
1 parent
c3c00d5d2e
commit
bb4d0979d3
1 file changed
+8
@@ -231,6 +231,12 @@ export function ChatPage({ snapshot, actions }: PageProps) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const openFile = (fileId: string) => {
|
||||||
|
void window.agentCompany.openFile({ orgId, fileId }).then((result) => {
|
||||||
|
if (!result.ok) throw new Error(result.error.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="split-main">
|
<div className="split-main">
|
||||||
<ChatSidebar
|
<ChatSidebar
|
||||||
@@ -268,6 +274,7 @@ export function ChatPage({ snapshot, actions }: PageProps) {
|
|||||||
onDecline={(approvalId) => decideApproval(approvalId, "declined")}
|
onDecline={(approvalId) => decideApproval(approvalId, "declined")}
|
||||||
onEditMessage={editChatMessage}
|
onEditMessage={editChatMessage}
|
||||||
onDeleteMessage={deleteChatMessage}
|
onDeleteMessage={deleteChatMessage}
|
||||||
|
onOpenFile={openFile}
|
||||||
onSubmit={sendInChannel}
|
onSubmit={sendInChannel}
|
||||||
composerRef={composerRef}
|
composerRef={composerRef}
|
||||||
/>
|
/>
|
||||||
@@ -288,6 +295,7 @@ export function ChatPage({ snapshot, actions }: PageProps) {
|
|||||||
onClose={() => setOpenThreadId(null)}
|
onClose={() => setOpenThreadId(null)}
|
||||||
onSubmit={sendInThread}
|
onSubmit={sendInThread}
|
||||||
onBoardSubmit={sendBoardIntervention}
|
onBoardSubmit={sendBoardIntervention}
|
||||||
|
onOpenFile={openFile}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user