feat: added a ReadButton to convert the text output from GPT into voice and read it out loud

This commit is contained in:
Petaflops
2023-05-18 09:15:08 +08:00
committed by josc146
parent efb7cc95c3
commit 6bb5a81304
3 changed files with 63 additions and 0 deletions
@@ -1,6 +1,7 @@
import { useState } from 'react'
import { ChevronDownIcon, XCircleIcon, SyncIcon } from '@primer/octicons-react'
import CopyButton from '../CopyButton'
import ReadButton from '../ReadButton'
import PropTypes from 'prop-types'
import MarkdownRender from '../MarkdownRender/markdown.jsx'
import { useTranslation } from 'react-i18next'
@@ -73,6 +74,9 @@ export function ConversationItem({ type, content, session, done, port, onRetry }
{session && (
<CopyButton contentFn={() => content.replace(/\n<hr\/>$/, '')} size={14} />
)}
{session && (
<ReadButton contentFn={() => content.replace(/\n<hr\/>$/, '')} size={14} />
)}
{!collapsed ? (
<span
title={t('Collapse')}