import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:krow_domain/krow_domain.dart';

/// A section displaying shift break details (duration and payment status).
class ShiftBreakSection extends StatelessWidget {
  /// The break information.
  final Break breakInfo;
  
  /// Localization string for break section title.
  final String breakTitle;
  
  /// Localization string for paid status.
  final String paidLabel;
  
  /// Localization string for unpaid status.
  final String unpaidLabel;
  
  /// Localization string for minutes ("min").
  final String minLabel;

  /// Creates a [ShiftBreakSection].
  const ShiftBreakSection({
    super.key,
    required this.breakInfo,
    required this.breakTitle,
    required this.paidLabel,
    required this.unpaidLabel,
    required this.minLabel,
  });

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(UiConstants.space5),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            breakTitle,
            style: UiTypography.titleUppercase4b.textSecondary,
          ),
          const SizedBox(height: UiConstants.space2),
          Row(
            children: [
              const Icon(
                UiIcons.breakIcon,
                size: 20,
                color: UiColors.primary,
              ),
              const SizedBox(width: UiConstants.space2),
              Text(
                "${breakInfo.duration.minutes} $minLabel (${breakInfo.isBreakPaid ? paidLabel : unpaidLabel})",
                style: UiTypography.headline5m.textPrimary,
              ),
            ],
          ),
        ],
      ),
    );
  }
}
