import 'package:flutter/material.dart';

import 'package:pweb/app/router/payout_routes.dart';
import 'package:pweb/widgets/sidebar/destinations.dart';

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


class UploadHistoryHeader extends StatelessWidget {
  const UploadHistoryHeader({
    super.key,
    required this.theme,
  });

  final ThemeData theme;

  static const double _smallBox = 5;

  @override
  Widget build(BuildContext context) {
    final l10 = AppLocalizations.of(context)!;
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Row(
          children: [
            const Icon(Icons.history),
            const SizedBox(width: _smallBox),
            Text(l10.uploadHistory, style: theme.textTheme.bodyLarge),
          ],
        ),
        TextButton.icon(
          onPressed: () => context.goToPayout(PayoutDestination.reports),
          icon: const Icon(Icons.open_in_new, size: 16),
          label: Text(l10.viewWholeHistory),
        ),
      ],
    );
  }
}
