Skip to content

Commit 071158c

Browse files
authored
feat: add chat type settings to the header. (#78)
1 parent 4d9ee64 commit 071158c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { useStore } from '@nanostores/solid'
2+
import { showConversationEditModal } from '@/stores/ui'
3+
import { currentConversationId } from '@/stores/conversation'
4+
5+
export default () => {
6+
// Retrieve the current conversation ID from the store
7+
const $currentConversationId = useStore(currentConversationId)
8+
9+
return (
10+
<>
11+
{/* Render the following code if the current conversation ID exists */}
12+
{$currentConversationId() && (
13+
<div
14+
class="fcc p-2 rounded-md text-xl hv-foreground"
15+
onClick={() => { showConversationEditModal.set(true) }}
16+
>
17+
{/* Render the carbon settings adjust icon */}
18+
<div i-carbon-settings-adjust />
19+
</div>
20+
)}
21+
</>
22+
)
23+
}

src/components/header/Header.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useLargeScreen } from '@/hooks'
44
import ConversationHeaderInfo from './ConversationHeaderInfo'
55
import ConversationMessageClearButton from './ConversationMessageClearButton'
66
import ConversationMessageShareButton from './ConversationMessageShareButton'
7+
import ConversationMessageSettingButton from './ConversationMessageSettingButton'
78

89
export default () => {
910
onMount(() => {
@@ -25,6 +26,7 @@ export default () => {
2526
<ConversationHeaderInfo />
2627
</div>
2728
<div class="fi gap-1 overflow-hidden">
29+
<ConversationMessageSettingButton />
2830
<ConversationMessageClearButton />
2931
<ConversationMessageShareButton />
3032
<div

0 commit comments

Comments
 (0)