mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 22:53:59 +01:00
parent
7a35e20fbb
commit
dcea49d6ad
|
@ -54,9 +54,9 @@ const ShowMoreButton = () => {
|
||||||
|
|
||||||
const ChatHistoryClass = {
|
const ChatHistoryClass = {
|
||||||
normal:
|
normal:
|
||||||
'flex py-3 px-3 items-center gap-3 relative rounded-md hover:bg-[#2A2B32] cursor-pointer break-all hover:pr-4 group',
|
'flex py-3 px-3 items-center gap-3 relative rounded-md hover:bg-[#2A2B32] break-all hover:pr-4 group',
|
||||||
active:
|
active:
|
||||||
'flex py-3 px-3 items-center gap-3 relative rounded-md cursor-pointer break-all pr-14 bg-gray-800 hover:bg-gray-800 group',
|
'flex py-3 px-3 items-center gap-3 relative rounded-md break-all pr-14 bg-gray-800 hover:bg-gray-800 group',
|
||||||
normalGradient:
|
normalGradient:
|
||||||
'absolute inset-y-0 right-0 w-8 z-10 bg-gradient-to-l from-gray-900 group-hover:from-[#2A2B32]',
|
'absolute inset-y-0 right-0 w-8 z-10 bg-gradient-to-l from-gray-900 group-hover:from-[#2A2B32]',
|
||||||
activeGradient:
|
activeGradient:
|
||||||
|
@ -69,6 +69,7 @@ const ChatHistory = React.memo(
|
||||||
const setCurrentChatIndex = useStore((state) => state.setCurrentChatIndex);
|
const setCurrentChatIndex = useStore((state) => state.setCurrentChatIndex);
|
||||||
const setChats = useStore((state) => state.setChats);
|
const setChats = useStore((state) => state.setChats);
|
||||||
const active = useStore((state) => state.currentChatIndex === chatIndex);
|
const active = useStore((state) => state.currentChatIndex === chatIndex);
|
||||||
|
const generating = useStore((state) => state.generating);
|
||||||
|
|
||||||
const [isDelete, setIsDelete] = useState<boolean>(false);
|
const [isDelete, setIsDelete] = useState<boolean>(false);
|
||||||
const [isEdit, setIsEdit] = useState<boolean>(false);
|
const [isEdit, setIsEdit] = useState<boolean>(false);
|
||||||
|
@ -107,9 +108,11 @@ const ChatHistory = React.memo(
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
className={active ? ChatHistoryClass.active : ChatHistoryClass.normal}
|
className={`${
|
||||||
onClick={(e) => {
|
active ? ChatHistoryClass.active : ChatHistoryClass.normal
|
||||||
setCurrentChatIndex(chatIndex);
|
} ${generating ? 'cursor-not-allowed' : 'cursor-pointer'}`}
|
||||||
|
onClick={() => {
|
||||||
|
if (!generating) setCurrentChatIndex(chatIndex);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ChatIcon />
|
<ChatIcon />
|
||||||
|
|
Loading…
Reference in a new issue