import React, { useState } from 'react'; import { t, useGroupPanel } from 'tailchat-shared'; import { PanelCommonHeader } from '../common/Header'; import _isNil from 'lodash/isNil'; import { Icon } from '@iconify/react'; import { Button } from 'antd'; import { MembersPanel } from './MembersPanel'; import clsx from 'clsx'; /** * 群组面板通用包装器 */ interface GroupPanelWrapperProps { groupId: string; panelId: string; } export const GroupPanelWrapper: React.FC = React.memo( (props) => { const panelInfo = useGroupPanel(props.groupId, props.panelId); const [rightPanel, setRightPanel] = useState<{ name: string; panel: React.ReactNode }>(); if (_isNil(panelInfo)) { return null; } return (
{/* 主面板 */}
} onClick={() => setRightPanel({ name: t('成员'), panel: , }) } />, ]} > {panelInfo.name}
{props.children}
{/* 右侧面板 */}
} onClick={() => setRightPanel(undefined)} />, ]} > {rightPanel?.name} {rightPanel?.panel}
); } ); GroupPanelWrapper.displayName = 'GroupPanelWrapper';