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

/// Alert widget for displaying late workers warning.
///
/// Shows a warning banner when there are late workers.
class LateWorkersAlert extends StatelessWidget {
  /// Creates a [LateWorkersAlert].
  const LateWorkersAlert({
    required this.lateCount,
    super.key,
  });

  /// The number of late workers.
  final int lateCount;

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(UiConstants.space3),
      decoration: BoxDecoration(
        color: UiColors.destructive.withValues(alpha: 0.1),
        borderRadius: UiConstants.radiusLg,
        border: Border.all(
          color: UiColors.destructive.withValues(alpha: 0.3),
        ),
      ),
      child: Row(
        children: <Widget>[
          const Icon(
            UiIcons.warning,
            color: UiColors.destructive,
            size: UiConstants.space5,
          ),
          const SizedBox(width: UiConstants.space3),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Text(
                  'Late Workers Alert',
                  style: UiTypography.body1b.copyWith(
                    color: UiColors.destructive,
                  ),
                ),
                const SizedBox(height: UiConstants.space1),
                Text(
                  '$lateCount ${lateCount == 1 ? 'worker is' : 'workers are'} running late',
                  style: UiTypography.body3r.copyWith(
                    color: UiColors.destructiveForeground,
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
