import type { GridZone, LayoutMetrics } from './types'

export interface GridTableProps {
  zone: GridZone
  layoutMetrics?: LayoutMetrics
  selectedCell: string | null
  selectedCells?: Set<string>
  onSelectCell: (cellId: string) => void
  onToggleCellSelection?: (cellId: string) => void
  onCellTextChange: (cellId: string, text: string) => void
  onToggleColumnBold: (zoneIndex: number, colIndex: number) => void
  onToggleRowHeader: (zoneIndex: number, rowIndex: number) => void
  onNavigate: (cellId: string, direction: 'up' | 'down' | 'left' | 'right') => void
  onDeleteColumn?: (zoneIndex: number, colIndex: number) => void
  onAddColumn?: (zoneIndex: number, afterColIndex: number) => void
  onDeleteRow?: (zoneIndex: number, rowIndex: number) => void
  onAddRow?: (zoneIndex: number, afterRowIndex: number) => void
  onSetCellColor?: (cellId: string, color: string | null | undefined) => void
}

/** Color palette for the right-click cell color menu. */
export const COLOR_OPTIONS: { label: string; value: string | null }[] = [
  { label: 'Rot', value: '#dc2626' },
  { label: 'Gruen', value: '#16a34a' },
  { label: 'Blau', value: '#2563eb' },
  { label: 'Orange', value: '#ea580c' },
  { label: 'Lila', value: '#9333ea' },
  { label: 'Schwarz', value: null },
]

/** Gutter width for row numbers (px). */
export const ROW_NUM_WIDTH = 36

/** Minimum column width in px so columns remain usable. */
export const MIN_COL_WIDTH = 80

/** Minimum row height in px. */
export const MIN_ROW_HEIGHT = 26
