// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

import 'package:flutter/foundation.dart';
import 'package:wyatt_ui_components/wyatt_ui_components.dart';

abstract class ButtonComponent extends Component {
  const ButtonComponent({
    this.disabledStyle,
    this.normalStyle,
    this.hoveredStyle,
    this.focusedStyle,
    this.tappedStyle,
    this.selectedStyle,
    this.invalidStyle,
    this.onPressed,
    this.disabled,
    super.themeResolver,
    super.key,
  });

  /// Style of this button in disabled state
  final ButtonStyle<dynamic>? disabledStyle;

  /// Style of this button in normal state
  final ButtonStyle<dynamic>? normalStyle;

  /// Style of this button in hovered state
  final ButtonStyle<dynamic>? hoveredStyle;

  /// Style of this button in focused state
  final ButtonStyle<dynamic>? focusedStyle;

  /// Style of this button in tapped state
  final ButtonStyle<dynamic>? tappedStyle;

  /// Style of this button in selected state
  final ButtonStyle<dynamic>? selectedStyle;

  /// Style of this button in invalid state
  final ButtonStyle<dynamic>? invalidStyle;

  /// Callback on button press,
  ///
  /// [ControlState] is passed as argument and can be used to determine if the
  /// button was pressed in disabled state or not.
  final void Function(ControlState state)? onPressed;

  /// Current state of this button
  final ValueNotifier<bool>? disabled;
}
