import { createContext } from 'react';

export type ConfigType = {
  height: number;
  width: number;
  rows: number;
  columns: number;
  displayColumns: number;
  interline: number;
  testLine: boolean;
  auto: boolean;
  twoPlaylists: boolean;
};

export interface ConfigContextType {
  config: ConfigType;
  setConfig: (config: ConfigType) => void;
}

export const InitConfig = {
  height: 48,
  width: 128,
  rows: 8,
  columns: 10,
  displayColumns: 4,
  interline: 16,
  testLine: false,
  auto: true,
  twoPlaylists: false,
};

const InitConfigContext: ConfigContextType = {
  config: InitConfig,
  setConfig: () => void 0,
};

export const ConfigContext = createContext<ConfigContextType>(
  InitConfigContext
);
