diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2025-10-04 18:36:10 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2025-10-04 18:36:10 -0700 |
| commit | 35add63ec4dce39710095f17abd86777de9e5b49 (patch) | |
| tree | 1afdf952f310e09a663e85541474efdc95155a73 /src/components/grid/Cell.tsx | |
| parent | 507c972ecafeceaf4f8962ad881f8fb50c9b86c1 (diff) | |
| download | ansicolor-35add63ec4dce39710095f17abd86777de9e5b49.tar.gz ansicolor-35add63ec4dce39710095f17abd86777de9e5b49.zip | |
Working history state
Diffstat (limited to 'src/components/grid/Cell.tsx')
| -rw-r--r-- | src/components/grid/Cell.tsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/components/grid/Cell.tsx b/src/components/grid/Cell.tsx new file mode 100644 index 0000000..fe91da8 --- /dev/null +++ b/src/components/grid/Cell.tsx @@ -0,0 +1,19 @@ +import type { GridCell } from '@/types/grid'; +import { getStyleForAnsiColor } from '@/utils/ansi'; + +interface CellProps { + cell: GridCell; + onClick?: () => void; +} + +export const Cell: React.FC<CellProps> = ({ cell, onClick }) => { + return ( + <span + className={`grid-cell ${onClick ? 'highlightable' : ''}`} + onMouseDown={onClick} + style={getStyleForAnsiColor(cell.color)} + > + {cell.char === ' ' ? '\u00A0' : cell.char} + </span> + ); +}; |
