mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
763 B
TypeScript
28 lines
763 B
TypeScript
4 years ago
|
import React from 'react';
|
||
|
import { useGroupPanel } from 'tailchat-shared';
|
||
|
import { PanelCommonHeader } from '../common/Header';
|
||
|
|
||
|
/**
|
||
|
* 群组面板通用包装器
|
||
|
*/
|
||
|
interface GroupPanelWrapperProps {
|
||
|
groupId: string;
|
||
|
panelId: string;
|
||
|
}
|
||
|
export const GroupPanelWrapper: React.FC<GroupPanelWrapperProps> = React.memo(
|
||
|
(props) => {
|
||
|
const panelInfo = useGroupPanel(props.groupId, props.panelId);
|
||
|
if (panelInfo === undefined) {
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
return (
|
||
|
<div className="w-full h-full flex flex-col overflow-hidden">
|
||
|
<PanelCommonHeader>{panelInfo.name}</PanelCommonHeader>
|
||
|
<div className="flex-1 overflow-hidden">{props.children}</div>
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
);
|
||
|
GroupPanelWrapper.displayName = 'GroupPanelWrapper';
|