Added export button

This commit is contained in:
eduardruzga
2024-11-22 11:51:52 +02:00
parent 60411550a5
commit 9f49c25f96
4 changed files with 38 additions and 5 deletions

View File

@@ -0,0 +1,16 @@
import WithTooltip from '~/components/ui/Tooltip';
import { IconButton } from '~/components/ui/IconButton';
import { exportChat } from '~/utils/chatExport';
import React from 'react';
import type { Message } from 'ai';
export const ExportChatButton = ({description, messages}: {description: string, messages: Message[]}) => {
return (<WithTooltip tooltip="Export Chat">
<IconButton
title="Export Chat"
onClick={() => exportChat(messages || [], description)}
>
<div className="i-ph:download-simple text-xl"></div>
</IconButton>
</WithTooltip>);
}