import classNames from 'classnames'
import Drawer from '@/components/ui/Drawer'
import SidePanelContent, { SidePanelContentProps } from './SidePanelContent'
import CopyButton from '../ThemeConfigurator/CopyButton'
import withHeaderItem from '@/utils/hoc/withHeaderItem'
import { useStoreState, useStoreActions } from '@/store'
import type { CommonProps } from '@/proxy/common'
import { useLocalization } from '@/utils/hooks/useLocalization'
import { FcEngineering } from 'react-icons/fc'
import { Tooltip } from '@/components/ui'
type SidePanelProps = SidePanelContentProps & CommonProps
const _SidePanel = (props: SidePanelProps) => {
const { setPanelExpand } = useStoreActions((actions) => actions.theme)
const { translate } = useLocalization()
const { className, ...rest } = props
const panelExpand = useStoreState((state) => state.theme.panelExpand)
const direction = useStoreState((state) => state.theme.direction)
const openPanel = () => {
setPanelExpand(true)
}
const closePanel = () => {
setPanelExpand(false)
const bodyClassList = document.body.classList
if (bodyClassList.contains('drawer-lock-scroll')) {
bodyClassList.remove('drawer-lock-scroll', 'drawer-open')
}
}
return (
<>
{translate('::SidePanel.Title')}
}
isOpen={panelExpand}
placement={direction === 'rtl' ? 'left' : 'right'}
width={375}
onClose={closePanel}
onRequestClose={closePanel}
>
>
)
}
const SidePanel = withHeaderItem(_SidePanel)
export default SidePanel