import classNames from 'classnames'; import { type ChangeEventHandler, type CSSProperties, type FocusEventHandler, type FunctionComponent, type KeyboardEventHandler, memo, type MouseEventHandler, type Ref, type TouchEventHandler, } from 'react'; import { ExclamationSquareFill } from 'icons'; import styles from './Tile.module.scss'; interface Props { 'aria-label': string; autoFocus?: boolean; canShowPoints?: boolean; character?: string; className?: string; disabled?: boolean; highlighted?: boolean; inputRef: Ref; isBlank?: boolean; isValid?: boolean; placeholder?: string; points?: number; pointsFormatted?: string; pointsStyle?: CSSProperties; raised?: boolean; style?: CSSProperties; tabIndex?: number; onChange?: ChangeEventHandler; onFocus?: FocusEventHandler; onKeyDown?: KeyboardEventHandler; onMouseDown?: MouseEventHandler; onTouchStart?: TouchEventHandler; } const TilePureBase: FunctionComponent = ({ 'aria-label': ariaLabel, autoFocus, canShowPoints, character, className, disabled, highlighted, inputRef, isBlank, isValid, placeholder, points, pointsFormatted, pointsStyle, raised, style, tabIndex, onChange, onFocus, onKeyDown, onMouseDown, onTouchStart, }) => (
= 5, [styles.raised]: raised, })} role={highlighted ? 'mark' : undefined} style={style} > {character || placeholder} {canShowPoints && ( {pointsFormatted} )} {!isValid &&
); export const TilePure = memo(TilePureBase);