mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-31 02:00:07 +02:00

Remove proptypes from editor-navigation-toolbar components GitOrigin-RevId: 77a1c4e13e3da6c06bb515b0137da2f70bfdf4a8
36 lines
998 B
TypeScript
36 lines
998 B
TypeScript
import classNames from 'classnames'
|
|
import { useTranslation } from 'react-i18next'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
import OLBadge from '@/features/ui/components/ol/ol-badge'
|
|
|
|
function ChatToggleButton({
|
|
chatIsOpen,
|
|
unreadMessageCount,
|
|
onClick,
|
|
}: {
|
|
chatIsOpen: boolean
|
|
unreadMessageCount: number
|
|
onClick: () => void
|
|
}) {
|
|
const { t } = useTranslation()
|
|
const classes = classNames('btn', 'btn-full-height', { active: chatIsOpen })
|
|
|
|
const hasUnreadMessages = unreadMessageCount > 0
|
|
|
|
return (
|
|
<div className="toolbar-item">
|
|
<button type="button" className={classes} onClick={onClick}>
|
|
<MaterialIcon
|
|
type="chat"
|
|
className={classNames('align-middle', {
|
|
bounce: hasUnreadMessages,
|
|
})}
|
|
/>
|
|
{hasUnreadMessages && <OLBadge bg="info">{unreadMessageCount}</OLBadge>}
|
|
<p className="toolbar-label">{t('chat')}</p>
|
|
</button>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default ChatToggleButton
|