summaryrefslogtreecommitdiff
path: root/src/components/grid/Cell.tsx
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-10-05 16:42:02 -0700
committerElizabeth Hunt <me@liz.coffee>2025-10-05 23:11:41 -0700
commitde43eb05d2e43ab31effce3dcca62ad91a556b26 (patch)
tree47a62b61bfc97dda639dea70627ecf3005ba7b02 /src/components/grid/Cell.tsx
parent35add63ec4dce39710095f17abd86777de9e5b49 (diff)
downloadansicolor-de43eb05d2e43ab31effce3dcca62ad91a556b26.tar.gz
ansicolor-de43eb05d2e43ab31effce3dcca62ad91a556b26.zip
Diffstat (limited to 'src/components/grid/Cell.tsx')
-rw-r--r--src/components/grid/Cell.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/components/grid/Cell.tsx b/src/components/grid/Cell.tsx
index fe91da8..1a21164 100644
--- a/src/components/grid/Cell.tsx
+++ b/src/components/grid/Cell.tsx
@@ -4,13 +4,20 @@ import { getStyleForAnsiColor } from '@/utils/ansi';
interface CellProps {
cell: GridCell;
onClick?: () => void;
+ onMouseEnter?: () => void;
}
-export const Cell: React.FC<CellProps> = ({ cell, onClick }) => {
+export const Cell: React.FC<CellProps> = ({ cell, onClick, onMouseEnter }) => {
+ const handleMouseDown = (e: React.MouseEvent) => {
+ e.preventDefault(); // Prevent text selection
+ onClick?.();
+ };
+
return (
<span
className={`grid-cell ${onClick ? 'highlightable' : ''}`}
- onMouseDown={onClick}
+ onMouseDown={handleMouseDown}
+ onMouseEnter={onMouseEnter}
style={getStyleForAnsiColor(cell.color)}
>
{cell.char === ' ' ? '\u00A0' : cell.char}