import 'package:flutter/material.dart';

import 'package:pweb/controllers/payouts/multiple_payouts.dart';

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


class UploadPanelActions extends StatelessWidget {
  const UploadPanelActions({
    super.key,
    required this.controller,
  });
  
  final MultiplePayoutsController controller;

  @override
  Widget build(BuildContext context) {
    final l10n = AppLocalizations.of(context)!;
    final hasFile = controller.selectedFileName != null;

    if (!hasFile) return const SizedBox.shrink();

    return TextButton(
      onPressed: controller.isBusy ? null : () => controller.pickAndQuote(),
      style: TextButton.styleFrom(
        padding: EdgeInsets.symmetric(
          horizontal: 24,
          vertical: 12,
        ),
      ),
      child: Text(l10n.changeFile),
    );
  }
}
