import { DeepPartial, PartiallyConstructible } from '../../utils';
import { RoundButton } from '../common/Common';

/**
Configuration of the buttons available in the action bar.
*/
export class ActionBarConfiguration extends PartiallyConstructible {
  /**
    Configuration of the 'flash' button.
    */
  public flashButton: RoundButton = new RoundButton({
    visible: true,
    backgroundColor: '?sbColorSurfaceHigh',
    foregroundColor: '?sbColorOnPrimary',
    activeBackgroundColor: '?sbColorWarning',
    activeForegroundColor: '#1C1B1F',
  });
  /**
    Configuration of the 'zoom' button.
    */
  public zoomButton: RoundButton = new RoundButton({
    visible: true,
    backgroundColor: '?sbColorSurfaceHigh',
    foregroundColor: '?sbColorOnPrimary',
    activeBackgroundColor: '?sbColorSurfaceHigh',
    activeForegroundColor: '?sbColorOnPrimary',
  });
  /**
    Configuration of the 'flip camera' button.
    */
  public flipCameraButton: RoundButton = new RoundButton({
    visible: true,
    backgroundColor: '?sbColorSurfaceHigh',
    foregroundColor: '?sbColorOnPrimary',
    activeBackgroundColor: '?sbColorSurfaceHigh',
    activeForegroundColor: '?sbColorOnPrimary',
  });

  /** @param source {@displayType `DeepPartial<ActionBarConfiguration>`} */
  public constructor(source: DeepPartial<ActionBarConfiguration> = {}) {
    super();
    if (source.flashButton !== undefined) {
      this.flashButton = new RoundButton(source.flashButton);
    }
    if (source.zoomButton !== undefined) {
      this.zoomButton = new RoundButton(source.zoomButton);
    }
    if (source.flipCameraButton !== undefined) {
      this.flipCameraButton = new RoundButton(source.flipCameraButton);
    }
  }
}
