import 'package:flutter/material.dart';

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


class FileFormatSampleDownloadButton extends StatelessWidget {
  const FileFormatSampleDownloadButton({
    super.key,
    required this.onPressed,
  });

  final VoidCallback onPressed;
  final double buttonWidth = 220;

  @override
  Widget build(BuildContext context) {
    final theme = Theme.of(context);
    final l10n = AppLocalizations.of(context)!;
    final textStyle = theme.textTheme.bodyMedium?.copyWith(
      color:  theme.colorScheme.onPrimary,
      fontWeight: FontWeight.w500,
    );

    return Align(
      alignment: Alignment.center,
      child: SizedBox(
        width: buttonWidth,
        child: FilledButton(
          onPressed: onPressed,
          style: FilledButton.styleFrom(
            backgroundColor: theme.colorScheme.primary,
            foregroundColor: theme.colorScheme.onPrimary,
            padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(10),
            ),
          ),
          child: Text(
            l10n.downloadSampleCSV,
            textAlign: TextAlign.center,
            style: textStyle,
          ),
        ),
      ),
    );
  }
}
