File size: 772 Bytes
a8aec61 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
'use client'
import { Button } from '@/components/ui/button'
import Icon from '@/components/ui/icon'
import useChatActions from '@/hooks/useChatActions'
import { usePlaygroundStore } from '@/store'
function NewChatButton() {
const { clearChat } = useChatActions()
const { messages } = usePlaygroundStore()
return (
<Button
className="z-10 cursor-pointer rounded bg-brand px-4 py-2 font-bold text-primary hover:bg-brand/80 disabled:cursor-not-allowed disabled:opacity-50"
onClick={clearChat}
disabled={messages.length === 0}
>
<div className="flex items-center gap-2">
<p>New Chat</p>{' '}
<Icon type="plus-icon" size="xs" className="text-background" />
</div>
</Button>
)
}
export default NewChatButton
|