fix: text copy issue (#723)

This commit is contained in:
Matri
2023-08-04 10:49:13 +08:00
committed by GitHub
parent 5d783a4922
commit a25e038a8b
6 changed files with 11 additions and 42 deletions

View File

@@ -3,13 +3,12 @@ import type { FC } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { ClipboardDocumentIcon, HandThumbDownIcon, HandThumbUpIcon } from '@heroicons/react/24/outline'
import { Feedbacktype } from '@/app/components/app/chat'
import copy from 'copy-to-clipboard'
import type { Feedbacktype } from '@/app/components/app/chat/type'
import Button from '@/app/components/base/button'
import Toast from '@/app/components/base/toast'
import Tooltip from '@/app/components/base/tooltip'
// import useCopyToClipboard from '@/hooks/use-copy-to-clipboard'
import copy from 'copy-to-clipboard'
type IResultHeaderProps = {
result: string
showFeedback: boolean
@@ -49,7 +48,7 @@ const Header: FC<IResultHeaderProps> = ({
<div
onClick={() => {
onFeedback({
rating: null
rating: null,
})
}}
className='flex w-7 h-7 items-center justify-center rounded-md cursor-pointer !text-primary-600 border border-primary-200 bg-primary-100 hover:border-primary-300 hover:bg-primary-200'>
@@ -66,7 +65,7 @@ const Header: FC<IResultHeaderProps> = ({
<div
onClick={() => {
onFeedback({
rating: null
rating: null,
})
}}
className='flex w-7 h-7 items-center justify-center rounded-md cursor-pointer !text-red-600 border border-red-200 bg-red-100 hover:border-red-300 hover:bg-red-200'>
@@ -84,7 +83,7 @@ const Header: FC<IResultHeaderProps> = ({
<div
onClick={() => {
onFeedback({
rating: 'like'
rating: 'like',
})
}}
className='flex w-6 h-6 items-center justify-center rounded-md cursor-pointer hover:bg-gray-100'>
@@ -98,7 +97,7 @@ const Header: FC<IResultHeaderProps> = ({
<div
onClick={() => {
onFeedback({
rating: 'dislike'
rating: 'dislike',
})
}}
className='flex w-6 h-6 items-center justify-center rounded-md cursor-pointer hover:bg-gray-100'>