overleaf-cep/services/web/frontend/js/features/review-panel-new/components/review-panel-entry-indicator.tsx
Alf Eaton bd67b4ca13 Improve review panel entry performance (#25402)
GitOrigin-RevId: 2a6ec8ad432195c6069bb58be37dd93341533817
2025-05-14 08:06:35 +00:00

27 lines
823 B
TypeScript

import { memo, MouseEventHandler } from 'react'
import MaterialIcon from '@/shared/components/material-icon'
export const EntryIndicator = memo<{
handleMouseEnter?: MouseEventHandler<HTMLDivElement>
handleMouseLeave?: MouseEventHandler<HTMLDivElement>
handleMouseDown?: MouseEventHandler<HTMLDivElement>
type: string
}>(function EntryIndicator({
handleMouseEnter,
handleMouseLeave,
handleMouseDown,
type,
}) {
return (
<div
className="review-panel-entry-indicator"
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
onMouseDown={handleMouseDown} // Using onMouseDown rather than onClick to guarantee that it fires before onFocus
role="button"
tabIndex={0}
>
<MaterialIcon type={type} className="review-panel-entry-icon" />
</div>
)
})