1
1
'use client' ;
2
2
3
3
import { ActionIcon , FluentEmoji , Icon , SideNav } from '@lobehub/ui' ;
4
- import { Dropdown , FloatButton } from 'antd' ;
4
+ import { FloatButton } from 'antd' ;
5
5
import { createStyles } from 'antd-style' ;
6
6
import { BugIcon , BugOff , XIcon } from 'lucide-react' ;
7
7
import { ReactNode , memo , useEffect , useState } from 'react' ;
@@ -81,7 +81,7 @@ interface CollapsibleFloatPanelProps {
81
81
const CollapsibleFloatPanel = memo < CollapsibleFloatPanelProps > ( ( { items } ) => {
82
82
const { styles, theme } = useStyles ( ) ;
83
83
const [ tab , setTab ] = useState < string > ( items [ 0 ] . key ) ;
84
- const [ isHide , setIsHide ] = useState ( false ) ;
84
+
85
85
const [ isExpanded , setIsExpanded ] = useState ( false ) ;
86
86
const [ position , setPosition ] = useState ( { x : 100 , y : 100 } ) ;
87
87
const [ size , setSize ] = useState ( { height : minHeight , width : minWidth } ) ;
@@ -108,29 +108,11 @@ const CollapsibleFloatPanel = memo<CollapsibleFloatPanelProps>(({ items }) => {
108
108
109
109
return (
110
110
< >
111
- { ! isHide && (
112
- < Dropdown
113
- menu = { {
114
- items : [
115
- {
116
- icon : (
117
- < Icon color = { theme . colorTextSecondary } icon = { BugOff } size = { { fontSize : 16 } } />
118
- ) ,
119
- key : 'hide' ,
120
- label : 'Hide Toolbar' ,
121
- onClick : ( ) => setIsHide ( true ) ,
122
- } ,
123
- ] ,
124
- } }
125
- trigger = { [ 'hover' ] }
126
- >
127
- < FloatButton
128
- className = { styles . floatButton }
129
- icon = { < Icon icon = { isExpanded ? BugOff : BugIcon } /> }
130
- onClick = { ( ) => setIsExpanded ( ! isExpanded ) }
131
- />
132
- </ Dropdown >
133
- ) }
111
+ < FloatButton
112
+ className = { styles . floatButton }
113
+ icon = { < Icon icon = { isExpanded ? BugOff : BugIcon } /> }
114
+ onClick = { ( ) => setIsExpanded ( ! isExpanded ) }
115
+ />
134
116
{ isExpanded && (
135
117
< Rnd
136
118
bounds = "window"
0 commit comments