Commit 7f5041ba by weiw

去掉校验

parent 944fd2ae
......@@ -4,6 +4,8 @@ import antfu from '@antfu/eslint-config'
export default antfu({
react: true,
rules: {
// 禁用缩进检查
'style/indent': 'off',
'n/prefer-global/process': ['off'], // 关闭process报错
'react-hooks/exhaustive-deps': ['off'],
'ban-ts-comment': ['off'],
......
......@@ -6,10 +6,7 @@ import { formatMarkdown } from '../Chat/components/ChatItem/markdownFormatter'
import { ChatAnswerAttachment } from '../Chat/components/ChatItem/ChatAnswerAttchment'
import styles from './Collect.module.less'
import { fetchQueryCollectionList } from '@/api/collect'
import CopyIcon from '@/assets/svg/copy.svg?react'
import DeleteIcon from '@/assets/svg/delete.svg?react'
import type { Answer } from '@/types/chat'
import useToast from '@/hooks/useToast'
import { fetchDelCollection } from '@/api/chat'
import { MarkdownDetail } from '@/components/MarkdownDetail'
import AIcon from '@/assets/svg/aicon.svg?react'
......@@ -28,7 +25,6 @@ export const Collect: React.FC = () => {
const [pageNum, setPageNum] = useState(1)
const [pageSize] = useState(5)
const [total, setTotal] = useState(0)
const showToast = useToast()
const getCollectList = async () => {
setIsLoading(true)
......@@ -47,18 +43,6 @@ export const Collect: React.FC = () => {
}, 500)
}
const handleCopy = async (item: Answer) => {
if (!navigator.clipboard) {
showToast('您的浏览器不支持复制', 'error')
return
}
const text = `问:${item.question}\n答:${item.answer}
`
await navigator.clipboard.writeText(text)
showToast('复制成功!快去分享吧!', 'success')
}
const handleDelete = (item: any) => {
setIsOpen(true)
setCollectId(item.collectionId)
......@@ -153,16 +137,6 @@ export const Collect: React.FC = () => {
<div className="mt-[12px] flex gap-[4px] justify-between items-center">
<div className="text-12px text-[#B2B8C1]">{item.collectionTime}</div>
<div>
<Tooltip color="foreground" content="复制" className="capitalize">
<Button
variant="light"
isIconOnly
aria-label="CopyIcon"
onPress={() => handleCopy(item)}
>
<CopyIcon />
</Button>
</Tooltip>
<Tooltip color="foreground" content="删除" className="capitalize">
<Button
variant="light"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment