import 'package:flutter/material.dart';

import 'package:pshared/models/payment/wallet.dart';
import 'package:pweb/utils/dimensions.dart';

import 'package:pweb/generated/i18n/app_localizations.dart';


class SaveWalletButton extends StatelessWidget {
  final Wallet wallet;
  final TextEditingController nameController;
  final TextEditingController balanceController;
  final VoidCallback onSave;

  const SaveWalletButton({
    super.key,
    required this.wallet,
    required this.nameController,
    required this.balanceController,
    required this.onSave,
  });

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context);
    final dimensions = AppDimensions();
    final loc = AppLocalizations.of(context)!;

    return Center(
      child: SizedBox(
        width: dimensions.buttonWidth,
        height: dimensions.buttonHeight,
        child: InkWell(
          borderRadius: BorderRadius.circular(dimensions.borderRadiusSmall),
          onTap: onSave,
          child: Container(
            decoration: BoxDecoration(
              color: theme.colorScheme.primary,
              borderRadius: BorderRadius.circular(dimensions.borderRadiusSmall),
            ),
            child: Center(
              child: Text(
                loc.save,
                style: theme.textTheme.bodyLarge?.copyWith(
                  color: theme.colorScheme.onSecondary,
                  fontWeight: FontWeight.w600,
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
