@@ -5,7 +5,7 @@ import InputBox from '../InputBox'
55import ConversationItem from '../ConversationItem'
66import { createElementAtPosition , initSession , isSafari } from '../../utils'
77import { DownloadIcon } from '@primer/octicons-react'
8- import { WindowDesktop , XLg } from 'react-bootstrap-icons'
8+ import { WindowDesktop , XLg , Pin } from 'react-bootstrap-icons'
99import FileSaver from 'file-saver'
1010import { render } from 'preact'
1111import FloatingToolbar from '../FloatingToolbar'
@@ -175,9 +175,7 @@ function ConversationCard(props) {
175175 return (
176176 < div className = "gpt-inner" >
177177 < div className = "gpt-header" >
178- { ! props . closeable ? (
179- < img src = { logo } width = "20" height = "20" style = "margin:5px 15px 0px;user-select:none;" />
180- ) : (
178+ { props . closeable ? (
181179 < XLg
182180 className = "gpt-util-icon"
183181 style = "margin:5px 15px 0px;"
@@ -187,6 +185,18 @@ function ConversationCard(props) {
187185 if ( props . onClose ) props . onClose ( )
188186 } }
189187 />
188+ ) : props . dockable ? (
189+ < Pin
190+ className = "gpt-util-icon"
191+ style = "margin:5px 15px 0px;"
192+ title = "Pin the Window"
193+ size = { 16 }
194+ onClick = { ( ) => {
195+ if ( props . onDock ) props . onDock ( )
196+ } }
197+ />
198+ ) : (
199+ < img src = { logo } width = "20" height = "20" style = "margin:5px 15px 0px;user-select:none;" />
190200 ) }
191201 { props . draggable ? (
192202 < div className = "dragbar" />
@@ -207,7 +217,6 @@ function ConversationCard(props) {
207217 container = { toolbarContainer }
208218 closeable = { true }
209219 triggered = { true }
210- onClose = { ( ) => toolbarContainer . remove ( ) }
211220 /> ,
212221 toolbarContainer ,
213222 )
@@ -278,6 +287,8 @@ ConversationCard.propTypes = {
278287 draggable : PropTypes . bool ,
279288 closeable : PropTypes . bool ,
280289 onClose : PropTypes . func ,
290+ dockable : PropTypes . bool ,
291+ onDock : PropTypes . func ,
281292}
282293
283294export default memo ( ConversationCard )
0 commit comments