import 'package:flutter/material.dart';

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


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

  static const double _verticalSpacing = 10;
  static const double _iconTextSpacing = 5;
  static const double _buttonVerticalPadding = 12;
  static const double _buttonHorizontalPadding = 24;

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

    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Row(
          children: [
            const Icon(Icons.upload),
            const SizedBox(width: _iconTextSpacing),
            Text(
              l10n.uploadCSV,
              style: theme.textTheme.bodyLarge?.copyWith(
                fontSize: 18,
                fontWeight: FontWeight.w600,
              ),
            ),
          ],
        ),
        const SizedBox(height: _verticalSpacing),
        Container(
          height: 140,
          decoration: BoxDecoration(
            border: Border.all(color: theme.colorScheme.outline),
            borderRadius: BorderRadius.circular(8),
          ),
          child: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Icon(Icons.upload_file, size: 36, color: theme.colorScheme.primary),
                const SizedBox(height: 8),
                ElevatedButton(
                  onPressed: () {},
                  style: ElevatedButton.styleFrom(
                    padding: const EdgeInsets.symmetric(
                      horizontal: _buttonHorizontalPadding,
                      vertical: _buttonVerticalPadding,
                    ),
                  ),
                  child: Text(l10n.upload),
                ),
                const SizedBox(height: 8),
                Text(
                  l10n.hintUpload,
                  style: const TextStyle(fontSize: 12),
                ),
              ],
            ),
          ),
        ),
      ],
    );
  }
}
