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
7a829213
Commit
7a829213
authored
Aug 08, 2024
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: history empty status
parent
6116c8f8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
30 deletions
+40
-30
src/assets/svg/empty.svg
+0
-0
src/layouts/HistoryBar/components/HistoryBarList/index.tsx
+40
-30
No files found.
src/assets/svg/empty.svg
0 → 100644
View file @
7a829213
This diff is collapsed.
Click to expand it.
src/layouts/HistoryBar/components/HistoryBarList/index.tsx
View file @
7a829213
import
{
motion
}
from
'framer-motion'
import
{
Button
}
from
'@nextui-org/react'
import
{
containerVariants
,
itemVariants
}
from
'../../motionAnimate'
import
EmptyIcon
from
'@/assets/svg/empty.svg?react'
import
{
useAppSelector
}
from
'@/store/hook'
export
const
HistoryBarList
:
React
.
FC
=
()
=>
{
const
{
conversations
}
=
useAppSelector
(
state
=>
state
.
conversation
)
return
(
<
motion
.
ul
variants=
{
containerVariants
}
initial=
"hidden"
animate=
"visible"
className=
"w-full flex flex-col gap-[6px]"
>
{
conversations
.
map
((
item
,
index
)
=>
(
<
motion
.
li
key=
{
`${item.conversationId}-${index}`
}
custom=
{
index
}
variants=
{
itemVariants
}
conversations
.
length
!==
0
?
(
<
motion
.
ul
variants=
{
containerVariants
}
initial=
"hidden"
animate=
"visible"
exit=
"exit"
layout
className=
"w-full flex flex-col gap-[6px]"
>
{
item
.
conversationId
?
(
<
Button
color=
"primary"
variant=
"light"
className=
"text-left w-full text-[#333] rounded-[23px] data-[hover=true]:bg-[#E5F6FF] data-[hover=true]:text-primary"
>
<
div
className=
"w-full text-nowrap text-ellipsis overflow-hidden"
>
<
span
>
{
item
.
conversationTitle
}
</
span
>
</
div
>
</
Button
>
)
:
(
<
div
className=
"mt-[32px] text-[13px] text-[#B1C6D2]"
>
{
item
.
conversationTitle
}
</
div
>
)
}
conversations
.
map
((
item
,
index
)
=>
(
<
motion
.
li
key=
{
`${item.conversationId}-${index}`
}
custom=
{
index
}
variants=
{
itemVariants
}
initial=
"hidden"
animate=
"visible"
exit=
"exit"
layout
>
{
item
.
conversationId
?
(
<
Button
color=
"primary"
variant=
"light"
className=
"text-left w-full text-[#333] rounded-[23px] data-[hover=true]:bg-[#E5F6FF] data-[hover=true]:text-primary"
>
<
div
className=
"w-full text-nowrap text-ellipsis overflow-hidden"
>
<
span
>
{
item
.
conversationTitle
}
</
span
>
</
div
>
</
Button
>
)
:
(
<
div
className=
"mt-[32px] text-[13px] text-[#B1C6D2]"
>
{
item
.
conversationTitle
}
</
div
>
)
}
</
motion
.
li
>
))
}
</
motion
.
ul
>
</
motion
.
li
>
))
}
</
motion
.
ul
>
)
:
(
<
div
className=
"flex w-full h-full items-center justify-center flex-col"
>
<
EmptyIcon
/>
<
p
className=
"text-[13px] text-[#27353C] mt-[16px]"
>
暂无历史对话
</
p
>
</
div
>
)
)
}
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