import React, { HTMLAttributes } from 'react'; import { HStack, IconButton, Text } from 'soapbox/components/ui'; interface IChatPaneHeader { isOpen: boolean isToggleable?: boolean onToggle(): void title: string | React.ReactNode unreadCount?: number } const ChatPaneHeader = (props: IChatPaneHeader) => { const { onToggle, isOpen, isToggleable = true, title, unreadCount } = props; const ButtonComp = isToggleable ? 'button' : 'div'; const buttonProps: HTMLAttributes = {}; if (isToggleable) { buttonProps.onClick = onToggle; } return ( {typeof title === 'string' ? ( {title} ) : (title)} {(typeof unreadCount !== 'undefined' && unreadCount > 0) && ( ({unreadCount})
)} ); }; export default ChatPaneHeader;