import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:pweb/pages/payment_page/wallet/edit/buttons/send.dart';
import 'package:pweb/pages/payment_page/wallet/edit/buttons/top_up.dart';
import 'package:pweb/providers/wallets.dart';
import 'package:pweb/utils/dimensions.dart';


class ButtonsWalletWidget extends StatelessWidget {
  const ButtonsWalletWidget({super.key});

  @override
  Widget build(BuildContext context) {
    final provider = context.watch<WalletsProvider>();
    final wallet = provider.wallets?.first;

    if (wallet == null) return const SizedBox.shrink();

    final dimensions = AppDimensions();

    return Container(
      decoration: BoxDecoration(
        color: Theme.of(context).colorScheme.surfaceBright,
        borderRadius: BorderRadius.circular(dimensions.borderRadiusSmall),
        boxShadow: [
          BoxShadow(
            color: Theme.of(context).colorScheme.primary.withAlpha(50),
            blurRadius: 4,
            offset: const Offset(0, 2),
          ),
        ],
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: [
          Expanded(
            child: SendPayoutButton(),
          ),
          VerticalDivider(
            color: Theme.of(context).colorScheme.primary,
            thickness: 1,
            width: 10,
          ),
          Expanded(
            child: TopUpButton(),
          ),
        ],
      ),
    );
  }
}