import 'package:flutter/material.dart';

import 'package:pweb/pages/dashboard/buttons/balance/config.dart';
import 'package:pweb/pages/dashboard/buttons/balance/source/layout/wide_body.dart';


class BalanceSourceCardLayout extends StatelessWidget {
  final String title;
  final String? subtitle;
  final String? badge;
  final Widget amount;
  final Widget refreshButton;
  final Widget actions;
  final VoidCallback? onTap;
  final String copyLabel;
  final bool canCopy;
  final VoidCallback? onCopy;

  const BalanceSourceCardLayout({
    super.key,
    required this.title,
    required this.subtitle,
    required this.badge,
    required this.amount,
    required this.refreshButton,
    required this.actions,
    required this.onTap,
    required this.copyLabel,
    required this.canCopy,
    required this.onCopy,
  });

  @override
  Widget build(BuildContext context) {
    final colorScheme = Theme.of(context).colorScheme;
    final borderRadius = BorderRadius.circular(WalletCardConfig.borderRadius);

    return Card(
      color: colorScheme.onSecondary,
      elevation: WalletCardConfig.elevation,
      shape: RoundedRectangleBorder(borderRadius: borderRadius),
      child: InkWell(
        borderRadius: borderRadius,
        onTap: onTap,
        child: SizedBox.expand(
          child: Padding(
            padding: WalletCardConfig.contentPadding,
            child: BalanceSourceBody(
              title: title,
              subtitle: subtitle,
              badge: badge,
              amount: amount,
              refreshButton: refreshButton,
              actions: actions,
              copyLabel: copyLabel,
              canCopy: canCopy,
              onCopy: onCopy,
            ),
          ),
        ),
      ),
    );
  }
}
