import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class PrimaryButton extends StatelessWidget{
  final onPressed;
  final String text;
  final Color color;
  final double height;
  final double? width;
  final double size;
  final double radius;
  final double padding;

  PrimaryButton({
    required this.onPressed,
    required this.text,
    required this.color,
    this.height = 60,
    this.width,
    this.size = 18,
    this.radius = 18,
    this.padding = 0,
  });

  @override
  Widget build(BuildContext context) {

    return FilledButton(
      style: ButtonStyle(
        backgroundColor: WidgetStatePropertyAll<Color>(color),
        padding: WidgetStatePropertyAll(EdgeInsets.symmetric(horizontal: padding)),
        shape: WidgetStatePropertyAll(RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(radius)),
        )),
      ),
      onPressed: onPressed,
      child: SizedBox(
        width: width,
        height: height,
        child: Center(child: Text(
          text,
          textAlign: TextAlign.center,
          style: TextStyle(
            fontSize: size,
            fontWeight: FontWeight.w500,
            letterSpacing: 0,
            color: Colors.white//theme.getColorFor(ThemeCode.textSecondary)
          )
        ))
      )
    );
  }
}