Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
5b8c978b
Commit
5b8c978b
authored
Dec 16, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:策略分析&用户分析时不展示收藏按钮
parent
b9deab47
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
src/pages/Chat/components/ChatItem/ChatAnswerOperate.tsx
+12
-6
No files found.
src/pages/Chat/components/ChatItem/ChatAnswerOperate.tsx
View file @
5b8c978b
import
{
Button
,
Tooltip
}
from
'@heroui/react'
import
{
useRef
,
useState
}
from
'react'
import
{
useLocation
}
from
'react-router-dom'
import
{
useDebounceFn
}
from
'ahooks'
import
type
{
Answer
}
from
'@/types/chat'
import
LikeIcon
from
'@/assets/svg/zan.svg?react'
...
...
@@ -18,6 +19,9 @@ interface ChatAnswerOperateProps {
}
export
const
ChatAnswerOperate
:
React
.
FC
<
ChatAnswerOperateProps
>
=
({
answer
})
=>
{
const
showToast
=
useToast
()
const
location
=
useLocation
()
const
searchParams
=
new
URLSearchParams
(
location
.
search
)
const
isFromTactics
=
searchParams
.
get
(
'from'
)
===
'tactics'
const
[
isCollect
,
setIsCollect
]
=
useState
(
answer
.
collectionFlag
)
const
[
isLike
,
setIsLike
]
=
useState
(
answer
.
feedbackStatus
===
'01'
)
const
[
isUnLike
,
setIsUnLike
]
=
useState
(
answer
.
feedbackStatus
===
'02'
)
...
...
@@ -136,12 +140,14 @@ export const ChatAnswerOperate: React.FC<ChatAnswerOperateProps> = ({ answer })
<
Tooltip
color=
"foreground"
content=
"复制"
className=
"capitalize"
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"CopyIcon"
onPress=
{
handleCopy
}
><
CopyIcon
/></
Button
>
</
Tooltip
>
{
/* 收藏 */
}
<
Tooltip
color=
"foreground"
content=
{
isCollect
?
'取消收藏'
:
'收藏'
}
className=
"capitalize"
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"CollectIcon"
onPress=
{
handleCollect
.
run
}
>
{
isCollect
?
<
CollectIconA
/>
:
<
CollectIcon
/>
}
</
Button
>
</
Tooltip
>
{
/* 收藏(当路由未标记 from=tactics 时展示) */
}
{
!
isFromTactics
&&
(
<
Tooltip
color=
"foreground"
content=
{
isCollect
?
'取消收藏'
:
'收藏'
}
className=
"capitalize"
>
<
Button
variant=
"light"
isIconOnly
aria
-
label=
"CollectIcon"
onPress=
{
handleCollect
.
run
}
>
{
isCollect
?
<
CollectIconA
/>
:
<
CollectIcon
/>
}
</
Button
>
</
Tooltip
>
)
}
{
/* 重新生成 */
}
{
/* <Tooltip color="foreground" content="重新生成" className="capitalize">
<Button variant="light" isIconOnly aria-label="ReloadIcon"><ReloadIcon /></Button>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment